<?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: Alvaro (Blag) Tejada Galindo</title>
    <description>The latest articles on DEV Community by Alvaro (Blag) Tejada Galindo (@blag).</description>
    <link>https://dev.to/blag</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%2F795029%2F2c52f681-01d7-4431-b424-23759eeb4a45.jpg</url>
      <title>DEV Community: Alvaro (Blag) Tejada Galindo</title>
      <link>https://dev.to/blag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/blag"/>
    <language>en</language>
    <item>
      <title>Introducing Frankie — The Programming Language — “It’s alive!” 🧟⚡</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Wed, 18 Mar 2026 17:06:19 +0000</pubDate>
      <link>https://dev.to/blag/introducing-frankie-the-programming-language-its-alive-3lk6</link>
      <guid>https://dev.to/blag/introducing-frankie-the-programming-language-its-alive-3lk6</guid>
      <description>&lt;p&gt;You might or might not, but I like to call myself a Programming Languages Archaeologist, mainly because I like to find and learn old programming languages that most likely nobody uses in modern day 🤓 But I also like learning about brand new programming languages.&lt;/p&gt;

&lt;p&gt;If you haven't read it already, I have a nice and ongoing series named Exploring Programming Languages, where I develop the same code in multiple programming languages. Currently, there are more than 60 🥹&lt;/p&gt;

&lt;p&gt;But anyway, let's talk about &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fatejada.github.io%2Ffrankielanguage%2F" rel="noopener noreferrer"&gt;Frankie - The Programming Language 🧟‍♂️&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I teamed up with Anthropic's Claude, and together we created, coded, vibe coded, whatever, a programming language which by definition is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Stitched together from Ruby • Python • R • Fortran&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Why? Because those 4 are my favourite programming languages 😅&lt;/p&gt;

&lt;p&gt;The foundation is Python, while the syntax is Ruby-like with commands that come from R and Fortran, besides obviously Ruby and Python.&lt;/p&gt;

&lt;p&gt;Frankie is an interpreted language that can be compiled to Python source code.&lt;/p&gt;

&lt;p&gt;Here are some features of the language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stitched from four languages&lt;/strong&gt; - Ruby's expressive syntax, Python's clean semantics, R's statistics and pipe operator (|&amp;gt;), and Fortran's do...while and integer division (//)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Proudly procedural&lt;/strong&gt; - functions, data, loops, and logic. No classes, no self, no inheritance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-in statistics&lt;/strong&gt; - mean(), stdev(), median(), min(), max(), and more, operating natively on vectors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;R-style pipe operator&lt;/strong&gt; - chain calls cleanly with |&amp;gt;, e.g. data |&amp;gt; sum |&amp;gt; puts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ruby-style iterators&lt;/strong&gt; - .each, .map, .select with do |x| ... end blocks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;String interpolation&lt;/strong&gt; - "Hello, #{name}!" just like Ruby&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error handling&lt;/strong&gt; - begin / rescue / ensure blocks with raise&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-in SQLite&lt;/strong&gt; - zero-dependency database access via db_open, db.insert, db.find_all, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;v1.3 extras&lt;/strong&gt; - JSON, CSV, DateTime, and HTTP support out of the box&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Zero dependencies&lt;/strong&gt; - runs on Python 3.10+, nothing else to install&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're curious, here's the &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fgithub.com%2Fatejada%2FFrankie" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; repo 😇. I would appreciate a couple of stars if possible 😉 I will try to improve Frankie as much as possible.&lt;/p&gt;

&lt;p&gt;Here's a small sample so you know what to expect 😁&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fibonacci&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 55&lt;/span&gt;

&lt;span class="c1"&gt;# R-style stats&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;67&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;stdev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;puts&lt;/span&gt;

&lt;span class="c1"&gt;# Iterators&lt;/span&gt;
&lt;span class="n"&gt;evens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;evens&lt;/span&gt;    &lt;span class="c1"&gt;# [2, 4, 6]&lt;/span&gt;

&lt;span class="c1"&gt;# Case/when&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;evens&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;
&lt;span class="k"&gt;when&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"three evens"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"something else"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# Destructuring&lt;/span&gt;
&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Range: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;..&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Error handling&lt;/span&gt;
&lt;span class="k"&gt;begin&lt;/span&gt;
  &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="s2"&gt;"oops"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;rescue&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Caught: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it for now. I hope you give Frankie some love and see you on the next Frankie release 🤩&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>python</category>
      <category>ruby</category>
    </item>
    <item>
      <title>7 SDK Generator Tools for APIs in 2025</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Thu, 16 Jan 2025 03:44:27 +0000</pubDate>
      <link>https://dev.to/blag/7-sdk-generator-tools-for-apis-in-2025-48ol</link>
      <guid>https://dev.to/blag/7-sdk-generator-tools-for-apis-in-2025-48ol</guid>
      <description>&lt;p&gt;As developers, we constantly seek ways to streamline our workflows and improve efficiency. One tool that’s gained traction in recent years is the SDK generator. These tools automate the creation of software development kits (SDKs) for APIs, simplifying the process of integrating external services into applications. In this post, we’ll dive into the world of SDK generator tools, examining their features, benefits, and how they can save valuable time for developers working with APIs.&lt;/p&gt;

&lt;p&gt;These tools can help you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Grow the number of developers building with your API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shorten the time to go live aka “time to 200”.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduce the number of support requests from developers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What’s on our agenda?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What is an SDK Generator tool?&lt;/li&gt;
&lt;li&gt;Why would you need one?&lt;/li&gt;
&lt;li&gt;How can we test them?&lt;/li&gt;
&lt;li&gt;My final verdict&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let’s analyze the available options&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIMatic&lt;/li&gt;
&lt;li&gt;OpenAPI-Generator&lt;/li&gt;
&lt;li&gt;Fern&lt;/li&gt;
&lt;li&gt;Stainless&lt;/li&gt;
&lt;li&gt;Speakeasy&lt;/li&gt;
&lt;li&gt;Kiota&lt;/li&gt;
&lt;li&gt;AutoRest&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is an SDK Generator tool
&lt;/h2&gt;

&lt;p&gt;When I think about software development, problem-solving and creating something new excites me. When designing scalable systems, optimizing performance, and crafting elegant solutions.&lt;/p&gt;

&lt;p&gt;But in reality, when connecting two software systems, the work can feel more repetitive than rewarding. Especially when working with HTTP APIs and sending JSON over the wire. This is where Software Development Kits (SDKs), the unsung heroes of modern web development, come in. SDKs are pre-written code, instructions, and reference documentation that help a dev build an integration faster and more reliably. This leads to a faster time to go live and less ongoing maintenance.&lt;/p&gt;

&lt;p&gt;When creating an SDK, there are three options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Write it manually. (Customizable, high quality, high cost, expensive to maintain)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use an open-source generator. (No cost, lower quality, requires an engineer to augment with custom scripts, no support)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use an SDK vendor. (Highest quality, can be offered instantly, Slack-based support, requires paid subscription)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Why It Matters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency:&lt;/strong&gt; Faster development with less boilerplate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; Standardized, easy-to-maintain SDKs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empowerment:&lt;/strong&gt; Developers can focus on building features, not handling low-level integrations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SDK generators are a smarter way to streamline development, improve scalability, and boost developer satisfaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would you need one
&lt;/h2&gt;

&lt;p&gt;The need for an SDK generator tool arises when efficiency, consistency, and scalability become priorities. If your team manages APIs or services that require integration across multiple platforms or programming languages, creating SDKs manually can be time-consuming and prone to errors. An SDK generator eliminates this bottleneck by providing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Savings:&lt;/strong&gt; Automating SDK creation frees up developers to focus on more critical tasks, such as improving core functionality or enhancing user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency:&lt;/strong&gt; Generated SDKs follow the same patterns and conventions, reducing the likelihood of inconsistencies across different language implementations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; As your platform evolves or new APIs are introduced, updating SDKs becomes a straightforward process, ensuring your integrations remain up-to-date without significant overhead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developer Enablement:&lt;/strong&gt; By offering prebuilt SDKs, you make it easier for external developers or clients to integrate with your platform, fostering a stronger and more productive developer community.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An SDK generator tool is about efficiency, scalability, and developer happiness. It’s not just a shortcut; it’s a smarter way to approach software development. So, if you’re managing APIs or developing platforms that others need to integrate with, it’s worth exploring how SDK generators can elevate your development game.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can we test them
&lt;/h2&gt;

&lt;p&gt;Not too long ago, I had the opportunity to write a blog post for my friends at Zuplo titled &lt;a href="https://zuplo.com/blog/2025/01/07/how-to-build-an-api-with-ruby-and-sinatra" rel="noopener noreferrer"&gt;How to Build an API with Ruby and Sinatra&lt;/a&gt;. In that post, I walked through the process of building a straightforward yet functional API using Ruby and the lightweight Sinatra framework. The goal was to show just how accessible API development can be, even for those who might be new to it.&lt;/p&gt;

&lt;p&gt;What made the process even more exciting was incorporating ChatGPT into the workflow. After building the API, I used ChatGPT to generate a complete OpenAPI Specification — a task that would have otherwise required a fair amount of manual effort and attention to detail. With just a bit of guidance, ChatGPT produced a spec that was not only accurate but ready to use, saving me valuable time.&lt;/p&gt;

&lt;p&gt;But the story doesn’t end there. That very OpenAPI Specification is now pulling double duty: it’s becoming the foundation for something even more practical. We’ll use it to test and compare a range of SDK generator tools to see how they perform and what they bring to the table. This process will shine a light on just how much these tools can simplify development by transforming API specs into ready-to-use SDKs in various programming languages. So stay tuned as we put these tools through their paces and explore the possibilities they offer for making integration faster and easier than ever.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Final Verdict
&lt;/h2&gt;

&lt;p&gt;After trying all these tools, two stand out: &lt;strong&gt;Fern&lt;/strong&gt; and &lt;strong&gt;APIMatic&lt;/strong&gt;. Both deliver an excellent user experience, great SDK production, and clear documentation, despite having completely different approaches. Since I value both the SDKs and documentation equally, I’d choose Fern for its SDKs because the code quality is clean, well-structured, and feels the most hand-written — it’s idiomatic and typesafe by default. Feel free to reach out with any questions or comments! I plan to update this article in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let analyze the available options
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://www.apimatic.io/" rel="noopener noreferrer"&gt;APIMatic&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpiqvcdeq5dlr3z749tvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpiqvcdeq5dlr3z749tvs.png" alt="Maximize API Adoption by Speaking Your Developers Language!" width="301" height="167"&gt;&lt;/a&gt; &lt;em&gt;Maximize API Adoption by Speaking Your Developers Language!&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Language SDK Generation&lt;/strong&gt; → It supports JavaScript, Python, Ruby, PHP, C#, Java, TypeScript, Objective-C, Go, and Dart. Support for Swift is coming soon.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Analytics and Insights → Offers usage analytics for SDKs and API documentation, giving insights into how developers are using your APIs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API Mocking → Provides mock servers for testing and simulating API responses without hitting live endpoints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Developer Experience → Provides a developer portal for easy access to SDKs, API documentation, and other resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API Transformations → Converts API descriptions between multiple formats (OpenAPI (Swagger), RAML, API Blueprint, Postman Collections, HAR (HTTP Archive), and more).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;APIMatic has an interesting requirement for registration: you need a business email address to sign up. However, I reached out to support, and they kindly provided me with a test user, so we’ll be able to discuss it.&lt;/p&gt;

&lt;p&gt;When we log into APIMatic, we’re greeted with two options for creating our SDK: either by describing the API manually or by importing an OpenAPI Specification. For simplicity and efficiency, we’re going to go with the second option — importing an OpenAPI Spec. This allows us to leverage an existing API definition to streamline the SDK generation process. Let’s dive in and get started!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u815s7ddk8oe706axyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u815s7ddk8oe706axyi.png" alt="Importing our OpenAPI Spec" width="800" height="311"&gt;&lt;/a&gt; &lt;em&gt;Importing our OpenAPI Spec&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to provide APIMatic with our OpenAPI Specification. There are two ways to do this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Upload the OpenAPI Spec directly from our local system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provide the URL where the file is hosted.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For this guide, we’ll go with the first option and upload the OpenAPI Spec directly. This straightforward approach ensures that APIMatic has everything it needs to generate the SDK efficiently. Let’s proceed with the upload and move on to the next step!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbtbdc028nckf3mo3r0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbtbdc028nckf3mo3r0r.png" alt="OpenAPI Spec selected" width="800" height="558"&gt;&lt;/a&gt; &lt;em&gt;OpenAPI Spec selected&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once the OpenAPI Spec is uploaded, APIMatic provides a helpful logging summary. This summary gives you a clear overview of the import process, highlighting any errors or warnings that may need our attention.&lt;/p&gt;

&lt;p&gt;It’s a great way to ensure that our API definition is in good shape before moving forward. If there are issues, we can address them right away, saving time and avoiding problems down the line. With everything in order, we’re ready to move on to the SDK generation!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uwznbipcpczj0rqdp0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uwznbipcpczj0rqdp0u.png" alt="Errors, Warning and Messages on our OpenAPI Spec" width="800" height="428"&gt;&lt;/a&gt; &lt;em&gt;Errors, Warning and Messages on our OpenAPI Spec&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once everything is processed, APIMatic generates two key resources for us:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The API Portal:&lt;/strong&gt; This is the comprehensive documentation for your API, neatly organized and ready to be explored.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The SDK:&lt;/strong&gt; The actual code for our SDK, which you can choose to either download for local use or publish, making it available for others to access and download.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For this guide, we’re going to take a closer look at the API Portal to review the documentation and ensure everything looks good. After that, we’ll download the SDK so we can test it locally on our machine. Let’s start by exploring the API Portal and see how the documentation turned out!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpu1m52ggb1h90lga7nb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpu1m52ggb1h90lga7nb.png" alt="Generation of SDK and Documentation" width="800" height="794"&gt;&lt;/a&gt; &lt;strong&gt;Generation of SDK and Documentation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The API Portal generated by APIMatic is impressively well-crafted. It provides a clear and organized list of all the API endpoints and models, making it easy to navigate and understand our API’s structure.&lt;/p&gt;

&lt;p&gt;One standout feature is the ability to choose the programming language for the SDK. APIMatic generates SDKs for multiple languages, and you can simply download the one you need — this flexibility is incredibly convenient for developers working in different tech stacks.&lt;/p&gt;

&lt;p&gt;Additionally, the portal offers options to either &lt;strong&gt;publish&lt;/strong&gt; or &lt;strong&gt;customize&lt;/strong&gt; it. The ability to tailor the portal to our brand or specific requirements adds significant value, especially if you plan to share it with external developers or stakeholders.&lt;/p&gt;

&lt;p&gt;Another thoughtful addition is the step-by-step tutorial embedded in the portal. This guide helps users get up to speed quickly, making the onboarding experience smoother and more intuitive. Overall, it’s a great combination of functionality and user experience!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1nrj8z46w067od19622.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1nrj8z46w067od19622.png" alt="Generated API Portal (Documentation)" width="800" height="573"&gt;&lt;/a&gt; &lt;em&gt;Generated API Portal (Documentation)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When it comes to customizing the API Portal, APIMatic offers a high level of flexibility — we can change just about everything. From the design and layout to the branding elements like logos, colors, and fonts, you have full control to tailor the portal to match our organization’s style and requirements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy17p5ntvq6mrrqp3ntvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy17p5ntvq6mrrqp3ntvy.png" alt="Personalization of API Portal" width="800" height="571"&gt;&lt;/a&gt; &lt;em&gt;Personalization of API Portal&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s proceed by downloading the Python SDK to see how it performs. Once downloaded, we’ll take a closer look at the generated code to evaluate its structure, functionality, and ease of use. After that, we can run some tests to explore how it behaves in a real-world scenario. Let’s dive in and put the SDK to the test!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6by8d3s26hmi2p7t0x7f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6by8d3s26hmi2p7t0x7f.png" alt="Selection an SDK Language" width="800" height="422"&gt;&lt;/a&gt; &lt;em&gt;Selection an SDK Language&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We selected Python as the target language and downloaded the SDK, which comes packaged neatly in a .zip file. Once the download is complete, we can extract the files to review the generated code and folder structure. From there, we’ll set up our environment and start experimenting with the SDK to see how well it integrates and performs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3v7xezsfxnyki930fixm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3v7xezsfxnyki930fixm.png" alt="SDK Generated in a .zip file" width="800" height="420"&gt;&lt;/a&gt; &lt;em&gt;SDK Generated in a .zip file&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once the SDK is unzipped and placed into our working directory, the next step is to set it up locally. This involves installing the dependencies, building the package, and then installing it. Open the terminal and run the following commands:&lt;/p&gt;

&lt;p&gt;Install the required dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build the SDK package using Poetry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the generated package locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install dist/dunequotesapi-1.0.0-py3-none-any.whl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the SDK installed, we’re ready to create a test script to put it through its paces. Here’s an example script you can use to test the functionality of the generated SDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dunequotesapi.dunequotesapi_client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;DunequotesapiClient&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DunequotesapiClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_quotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ==&amp;gt; #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://openapi-generator.tech/" rel="noopener noreferrer"&gt;OpenAPI Generator&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvab4gu7mhf03koyzn3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvab4gu7mhf03koyzn3j.png" alt="Generate clients, servers, and documentation from OpenAPI 2.0/3.x documents" width="533" height="200"&gt;&lt;/a&gt; &lt;em&gt;Generate clients, servers, and documentation from OpenAPI 2.0/3.x documents&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Language SDK Generation&lt;/strong&gt; → Supports over 50 programming languages for SDK and client library generation, including Java, TypeScript, Python, Ruby, PHP, C#, Go, Swift, Kotlin, Dart, JavaScript, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wide Compatibility&lt;/strong&gt; → Supports OpenAPI Specification versions 2.0, 3.0, and 3.1, making it compatible with modern API designs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community and Open Source&lt;/strong&gt; → Fully open-source with a large, active community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Plugins and Ecosystem Support&lt;/strong&gt; → Integrates well with tools like Swagger Editor, Postman, and API Gateway platforms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy Integration with CI/CD&lt;/strong&gt; → Easily integrates into CI/CD pipelines to ensure SDKs and server stubs are automatically updated with API changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First things first, we need to get the OpenAPI-Generator CLI installed. While there are many ways to install it, I prefer using Homebrew for its simplicity. Run the following command to get started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install openapi-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the CLI installed, the next step is to generate the SDK. In this case, we’ll target Ruby. To do so, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openapi-generator generate -i DuneQuotesSpec.yaml -g ruby -o /tmp/test/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just like that, our Ruby SDK is up and running! However, I have to admit that testing the generated SDK wasn’t as smooth as I’d hoped. Browsing through the generated folders and files felt a bit cumbersome. Finding exactly what I needed took more effort than expected, and the naming conventions didn’t quite align with my expectations. This made the process of exploring and testing the SDK more time-consuming than it should have been:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'openapi_client'&lt;/span&gt;

&lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;OpenapiClient&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;DefaultApi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;api_v1_quotes_get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
 &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ==&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo637vrrjjnvea5wd0g86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo637vrrjjnvea5wd0g86.png" alt="OpenAPI Generator — Running the Ruby SDK" width="800" height="409"&gt;&lt;/a&gt; &lt;em&gt;OpenAPI Generator — Running the Ruby SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You might be wondering how to generate documentation for our API. Luckily, OpenAPI-Generator makes this an incredibly straightforward task. All you need to do is run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openapi-generator generate -i DuneQuotesSpec.yaml -g html -o docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate a set of clean, HTML-based documentation for our API and save it to the docs folder. With just one command, you’ll have a professional-looking API reference that’s ready to share with our team or users. Simple and effective!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqiw890lwv5f1u58csmta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqiw890lwv5f1u58csmta.png" alt="Generated documentation for the SDK" width="800" height="571"&gt;&lt;/a&gt; &lt;em&gt;Generated documentation for the SDK&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://buildwithfern.com/" rel="noopener noreferrer"&gt;Fern&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5jqwpiwi1mtzo3df7d1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5jqwpiwi1mtzo3df7d1.png" alt="Instant SDKs and API Docs" width="380" height="133"&gt;&lt;/a&gt; &lt;em&gt;Instant SDKs and API Docs&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Language Support&lt;/strong&gt; → It supports TypeScript, Python, Java, Go, Ruby, PHP, and C#. Support for Swift, Rust, Terraform, and CLI is coming soon.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seamless API Documentation&lt;/strong&gt; → Automatically generates developer-friendly API documentation that integrates with your SDKs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unified Tooling&lt;/strong&gt; → Fern combines SDK generation and API documentation into a single platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developer-Focused Experience&lt;/strong&gt; → Provides a modern, easy-to-use CLI and toolchain that simplifies SDK creation and maintenance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Focus on CI/CD Integration&lt;/strong&gt; → Easily integrates into CI/CD pipelines for automated SDK updates when API specifications change.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First things first, we need to get the Fern CLI installed. To do this, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g fern-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, the next step is to initialize the Fern folder. Using our OpenAPI specification file, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fern init --openapi duneQuotesSpec.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will set up a working environment for Fern. Now, it’s time to add the language we want to target. In this case, we’ll be generating an SDK for Ruby. To add Ruby as the target language, execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fern add fern-ruby-sdk --group SDK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With everything configured, we’re ready to generate the SDK, which was idiomatic, typesafe, and overall perfectly organized and easy to read. Run the following command to kick off the generation process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fern generate --group SDK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it! We just generated a Ruby SDK with Fern, using our OpenAPI specification as the foundation.&lt;/p&gt;

&lt;p&gt;To put the generated SDK to the test, I created a straightforward file to ensure everything works as expected. This file serves as a basic playground to verify that the SDK functions correctly and interacts seamlessly with the API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'atejada_api_client'&lt;/span&gt;

&lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;AtejadaApiClient&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nb"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_quotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
 &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ==&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr6etih7f1cquzu27x9s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr6etih7f1cquzu27x9s.png" alt="Fern — Running the Ruby SDK" width="800" height="409"&gt;&lt;/a&gt; &lt;em&gt;Fern — Running the Ruby SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But what about documentation? After all, an SDK is only as good as its documentation — developers need clear, accessible guidance to make the most of it. Thankfully, Fern makes this process just as simple. To generate documentation, we need to start by initializing the docs folder with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fern init --docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the folder is set up, generating the documentation is just as straightforward. Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fern generate --docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it! We now have properly generated documentation to complement our SDK, ensuring developers have all the tools they need to integrate seamlessly with our API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgval5yyko2zqifa7jg5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgval5yyko2zqifa7jg5d.png" alt="Generated documentation for the Ruby SDK" width="800" height="560"&gt;&lt;/a&gt; &lt;em&gt;Generated documentation for the Ruby SDK&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://www.stainless.com/" rel="noopener noreferrer"&gt;Stainless&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9rai2heait9j3jt9r8q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9rai2heait9j3jt9r8q.png" alt="Generate best-in-class SDKs" width="552" height="91"&gt;&lt;/a&gt; &lt;em&gt;Generate best-in-class SDKs&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SDK Generation&lt;/strong&gt; → It supports Node/TypeScript, Python, Go, Java, Kotlin, Ruby, and Terraform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Typed Models and Strong Validation&lt;/strong&gt; → Generates strongly-typed models to improve reliability and usability in SDKs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Streamlined Updates&lt;/strong&gt; → Automates SDK updates whenever API specifications change, ensuring the SDKs stay in sync with the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lightweight and Modern&lt;/strong&gt; → Stainless is a lightweight, modern tool built for fast-moving teams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simplified Authentication&lt;/strong&gt; → Built-in support for various authentication methods, including OAuth2, API keys, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To generate our SDK, the first step is to provide some essential information and upload our OpenAPI Specification file. This ensures that the tool has everything it needs to create a tailored SDK based on the API’s structure and endpoints. The process is straightforward, and once the details are filled in, you’re ready to kick off the generation!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fom3f5ofqlhb00oq2wyjx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fom3f5ofqlhb00oq2wyjx.png" alt="Stainless sign up page" width="800" height="474"&gt;&lt;/a&gt; &lt;em&gt;Stainless sign up page&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By default, once the generation process is complete, the tool provides two SDKs ready to use: one for Node.js and another for Python. This makes it easy to get started with two of the most popular programming environments right away, catering to both backend and scripting needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmqlc0artveuprvmgz3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmqlc0artveuprvmgz3o.png" alt="Stainless SDK overview page" width="800" height="414"&gt;&lt;/a&gt; &lt;em&gt;Stainless SDK overview page&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That said, since we’re aiming to generate a Ruby SDK, the next step is to click on the “Add SDKs” button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2o0cfujvu8nn8yq11gy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2o0cfujvu8nn8yq11gy.png" alt="Available languages" width="800" height="1342"&gt;&lt;/a&gt; &lt;em&gt;Available languages&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I could opt for Go, request Java or Kotlin, but Ruby isn’t available just yet. Not a major issue, though — we can always test our solution using Python.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbcwpdcpvso4a0zrbw2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbcwpdcpvso4a0zrbw2y.png" alt="SDK Generated Private Repo" width="800" height="576"&gt;&lt;/a&gt; &lt;em&gt;SDK Generated Private Repo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By heading to the GitHub-generated repo, we can find the installation instructions and testing steps, which will undoubtedly save us a significant amount of work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dunequotes&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dunequotes&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Dunequotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ==&amp;gt; #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5rvh4bsotjh3c5b6sxa3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5rvh4bsotjh3c5b6sxa3.png" alt="Stainless generated Python SDK" width="800" height="522"&gt;&lt;/a&gt; &lt;em&gt;Stainless generated Python SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, where are the docs? Unfortunately, I couldn’t find them. The GitHub repo points to &lt;a href="https://docs.dunequotes.com/" rel="noopener noreferrer"&gt;https://docs.dunequotes.com/&lt;/a&gt;, but that path doesn’t exist. I even searched through the entire repo and came up empty-handed.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://www.speakeasy.com/" rel="noopener noreferrer"&gt;Speakeasy&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2p67zexk321j087btan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2p67zexk321j087btan.png" alt="The platform to Build APIs your users love" width="800" height="533"&gt;&lt;/a&gt; &lt;em&gt;The platform to Build APIs your users love&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Idiomatic SDK Generation&lt;/strong&gt; → Generates developer-friendly SDKs in multiple programming languages, such as TypeScript, Python, Go, Java, C#, PHP [beta], Unity [beta], Ruby [alpha], and Swift [alpha]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Consumer-First Focus&lt;/strong&gt; → Speakeasy is built with API consumers in mind, ensuring the SDKs are easy to use, maintain, and integrate into existing projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-In API Documentation&lt;/strong&gt; → Generates comprehensive API documentation alongside SDKs, making it easy for developers to understand and use the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Analytics and Observability&lt;/strong&gt; → Provides insights into how your APIs and SDKs are being used by consumers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lightweight Tooling&lt;/strong&gt; → Speakeasy is designed to be lightweight and easy to adopt, with a modern CLI and APIs for quick setup and management.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first step is to install the Speakeasy CLI client. Fortunately, this can be easily done using Homebrew. Simply run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install speakeasy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will set up the Speakeasy CLI on our system, allowing you to start working with it right away. Brew makes the installation process quick and hassle-free!&lt;/p&gt;

&lt;p&gt;Once the installation is complete, the next step is to initialize Speakeasy by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;speakeasy quickstart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command guides you through the setup process, making it easy to get started with Speakeasy. It’s designed to help you configure everything you need in just a few simple steps!&lt;/p&gt;

&lt;p&gt;After running the speakeasy quickstart command, we’ll be prompted to select our workspace. Simply choose the appropriate workspace for our project, and once that’s done, you can return to the CLI to continue with the setup process. It’s a smooth and straightforward workflow designed to keep things efficient!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisjphltyy8pi50mgbkmw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisjphltyy8pi50mgbkmw.png" alt="Selecting our workspace" width="800" height="487"&gt;&lt;/a&gt; &lt;em&gt;Selecting our workspace&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p2cx909w3fjmp0eq61h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p2cx909w3fjmp0eq61h.png" alt="Select OpenAPI Document Location" width="800" height="518"&gt;&lt;/a&gt; &lt;em&gt;Select OpenAPI Document Location&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbssqn687ksx9bpdrej3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbssqn687ksx9bpdrej3f.png" alt="Naming our SDK" width="800" height="516"&gt;&lt;/a&gt; &lt;em&gt;Naming our SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mhis1o7dyw1ix0jk6f9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mhis1o7dyw1ix0jk6f9.png" alt="Choosing our language" width="800" height="518"&gt;&lt;/a&gt; &lt;em&gt;Choosing our language&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5howgw5h197emwb63ck6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5howgw5h197emwb63ck6.png" alt="Choosing the package name" width="800" height="523"&gt;&lt;/a&gt; &lt;em&gt;Choosing the package name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftadurohq24hnzn8ybth9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftadurohq24hnzn8ybth9.png" alt="Output directory for the generated SDK" width="800" height="517"&gt;&lt;/a&gt; &lt;em&gt;Output directory for the generated SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7z0p8d9yjgx62tpjtbuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7z0p8d9yjgx62tpjtbuo.png" alt="Initilizing Git repo" width="800" height="522"&gt;&lt;/a&gt; &lt;em&gt;Initilizing Git repo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqt246zooirv6dkjvqu0o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqt246zooirv6dkjvqu0o.png" alt="Python SDK Generated" width="800" height="517"&gt;&lt;/a&gt; &lt;em&gt;Python SDK Generated&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwol9jx8ufaq33lqs1t5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwol9jx8ufaq33lqs1t5.png" alt="All done!" width="800" height="537"&gt;&lt;/a&gt; &lt;em&gt;All done!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Back in the CLI, navigate to the dune-quotes-python folder using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd dune-quotes-python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you’re in the folder, run the following command to install the necessary dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will ensure that all required packages are installed and our Python environment is properly set up, making it ready to work with the generated SDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dune_quotes&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;DuneQuotes&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DuneQuotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_api_v1_quotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ==&amp;gt; #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y4ujh7mg775k67c7kw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y4ujh7mg775k67c7kw9.png" alt="Speakeasy generated Python SDK&amp;lt;br&amp;gt;
" width="800" height="517"&gt;&lt;/a&gt; &lt;em&gt;Speakeasy generated Python SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All good, but where’s the documentation? How are our users going to know how to use our API? Well, that’s easy. We just need to browse the generated folder and we will find the docs folder and inside the sdks folder and inside the duneQuotes folder and finally inside an README.md file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vd3dpdallclikki4gaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vd3dpdallclikki4gaw.png" alt="Generated Documentation for the SDK" width="800" height="727"&gt;&lt;/a&gt; &lt;em&gt;Generated Documentation for the SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While the process was relatively straightforward, I found it to involve quite a few steps. Personally, it felt a bit more complex than I would have liked because there were so many steps for something that could had been just a single form instead of multiple screens, but that might just be my perspective. For someone looking for a quicker setup, the number of commands and configurations might feel a little overwhelming.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://learn.microsoft.com/en-us/openapi/kiota/overview" rel="noopener noreferrer"&gt;Kiota&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famut4bysyxoe0baipf52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famut4bysyxoe0baipf52.png" alt="A command-line tool for generating an API client to call any OpenAPI-described API you’re interested in." width="800" height="279"&gt;&lt;/a&gt; &lt;em&gt;A command-line tool for generating an API client to call any OpenAPI-described API you’re interested in.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Idiomatic SDK Generation&lt;/strong&gt; → Supports multiple programming languages, including .NET, CLI, Go, Java, PHP, Python, and TypeScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strong Typing and Validation&lt;/strong&gt; → Generates SDKs with strongly-typed models to minimize runtime errors and improve code reliability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimized for Microsoft Ecosystem&lt;/strong&gt; → Initially designed to generate SDKs for the Microsoft Graph API, making it highly optimized for APIs with complex schemas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open Source&lt;/strong&gt; → Fully open-source with an active development community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lightweight CLI Tool&lt;/strong&gt; → Provides a simple and easy-to-use command-line interface (CLI) for generating SDKs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each programming language comes with its own specific set of instructions for setup and usage. Since there isn’t a predefined guide for Ruby, we’ll go with Python instead. Python’s instructions are well-documented and straightforward, making it a practical choice for this demonstration.&lt;/p&gt;

&lt;p&gt;Let’s kick off by creating a brand-new folder to organize our project. We’ll name it kiota-duneQuotes to keep everything neat and aligned with the theme. To do this, simply run the command mkdir kiota-duneQuotes. This will generate an empty folder in the current directory, ready to house all the necessary files for our task.&lt;/p&gt;

&lt;p&gt;Next, we need to transfer the OpenAPI specification, DuneQuotesSpec.yaml, into our newly created folder. This step ensures that all our resources are in the right place and easily accessible for the next stages of the project. To achieve this, use the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp DuneQuotesSpec.yaml kiota-duneQuotes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which will copy the spec into the kiota-duneQuotes folder.&lt;/p&gt;

&lt;p&gt;Now, we have the groundwork set up and the OpenAPI specification safely stored in its designated directory, ready for further exploration and development.&lt;/p&gt;

&lt;p&gt;We need to run the following commands to get the required dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install microsoft-kiota-abstractions
pip install microsoft-kiota-http
pip install microsoft-kiota-serialization-json
pip install microsoft-kiota-serialization-text
pip install microsoft-kiota-serialization-form
pip install microsoft-kiota-serialization-multipart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before we dive any deeper into the process, there’s one crucial step we need to address: installing Kiota itself. While there are several ways to go about this, for the sake of simplicity and efficiency, we’re going to choose the method of using the Kiota binaries. This approach allows us to quickly set up Kiota without getting bogged down in dependencies or complex configurations.&lt;/p&gt;

&lt;p&gt;To get started, we’ll download the &lt;a href="https://learn.microsoft.com/en-us/openapi/kiota/install?tabs=bash#download-binaries" rel="noopener noreferrer"&gt;Kiota binaries&lt;/a&gt;, ensuring that we have the right version for our operating system. Once the binaries are in place, we’ll be able to run Kiota commands seamlessly and proceed with generating our SDK without any interruptions.&lt;/p&gt;

&lt;p&gt;Now that we’ve set everything up, we’re all set to generate the SDK files. This is the exciting part where the tools come together and start creating the necessary code for our project.&lt;/p&gt;

&lt;p&gt;To generate the SDK files, we’ll use the kiota generate command, which will take the OpenAPI spec we’ve stored in the kiota-duneQuotes folder and generate a Python SDK for us. The command we’ll run is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kiota generate -l python -c PostsClient -n client -d DuneQuotesSpec.yaml -o ./client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the SDK is successfully generated, we can move on to the next important step: creating our test file. This test file will allow us to validate the functionality of the generated SDK, ensuring everything is working as expected and that we can interact with the API seamlessly.&lt;/p&gt;

&lt;p&gt;We’ll need to create a new file where we can write our tests, using the SDK methods and functionality we’ve just generated. This will allow us to simulate interactions with the API, test various endpoints, and check for expected behaviors in a controlled environment.&lt;/p&gt;

&lt;p&gt;By setting up a test file, we can catch any potential issues early and ensure that our SDK integrates smoothly with the rest of the application. Let’s proceed with creating the test file and diving into the testing process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;kiota_abstractions.authentication.anonymous_authentication_provider&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;
    &lt;span class="n"&gt;AnonymousAuthenticationProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;kiota_http.httpx_request_adapter&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;HttpxRequestAdapter&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;client.posts_client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PostsClient&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;auth_provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AnonymousAuthenticationProvider&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;request_adapter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;HttpxRequestAdapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth_provider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PostsClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request_adapter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;character&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ==&amp;gt; #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3653wq8wti5sgo4c0esu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3653wq8wti5sgo4c0esu.png" alt="Kiota generated Python SDK" width="800" height="522"&gt;&lt;/a&gt; &lt;em&gt;Kiota generated Python SDK&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While generating the SDK was a relatively straightforward process, integrating it into our sample script proved to be a bit more challenging. It took me some time to figure out the correct structure and how to properly invoke the SDK in our code. The complexity arose because the generated files weren’t immediately intuitive, and the documentation to guide us through this process wasn’t readily available.&lt;/p&gt;

&lt;p&gt;I also ran into another roadblock: I haven’t been able to find any clear documentation on how to generate or access the documentation for the SDK itself. This lack of generated docs makes it a bit harder to understand the methods and properties available within the SDK, leaving us to rely more heavily on the generated code and trial-and-error to figure things out.&lt;/p&gt;

&lt;p&gt;Despite these hurdles, I’ve been working through the process, experimenting with the generated files to uncover the right structure and method calls. It’s a bit more manual than I anticipated, but with persistence, I’m confident we can get it all running smoothly. If I do find a way to generate documentation or discover any helpful resources, I’ll be sure to share them to streamline the process moving forward.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://azure.github.io/autorest/" rel="noopener noreferrer"&gt;AutoRest&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flujzlfz9qw60u6qpvcc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flujzlfz9qw60u6qpvcc5.png" alt="Generate code from your OpenAPI definition using AutoRest" width="640" height="303"&gt;&lt;/a&gt; &lt;em&gt;Generate code from your OpenAPI definition using AutoRest&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Language SDK Generation&lt;/strong&gt; → Support for Python, C#, Java, TypeScript, Go, and PowerShell. Swift is coming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Documentation Generation&lt;/strong&gt; → Generates API documentation alongside SDKs in various formats (Markdown, HTML, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-in Azure Support&lt;/strong&gt; → Provides out-of-the-box integration with Azure SDKs and can generate Azure-specific client libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strong Typing and Validation&lt;/strong&gt; → Generates strongly-typed models and client code, reducing runtime errors and improving code reliability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration with CI/CD&lt;/strong&gt; → Easily integrates with CI/CD workflows to ensure that SDKs and client libraries are kept up to date with API changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s kick things off by installing AutoRest, a powerful SDK generation tool. Thankfully, the installation process is straightforward and can be done directly from the terminal. Simply run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g autorest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command installs AutoRest globally on our system, making it accessible from anywhere in our terminal. Once installed, you’ll have all the tools you need to start generating SDKs efficiently. Let’s complete this setup so we can move on to exploring AutoRest’s capabilities!&lt;/p&gt;

&lt;p&gt;Now, let’s generate a Python client using AutoRest. This process will take our API specification and create a fully functional SDK for interacting with it. To do this, run the following command in our terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;autorest --input-file=DuneQuotesSpec.yaml --python --output-folder=RestQuotes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you run this command, AutoRest will work its magic and generate a Python client within the RestQuotes folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2kkm02k8h6d39biswyu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2kkm02k8h6d39biswyu.png" alt="Running AutoRest and getting some erros" width="800" height="523"&gt;&lt;/a&gt; &lt;em&gt;Running AutoRest and getting some erros&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Except, things didn’t go as smoothly as expected — AutoRest threw some rather cryptic errors during the generation process. At first glance, it wasn’t immediately clear what was causing the issue.&lt;/p&gt;

&lt;p&gt;After some digging and troubleshooting, I discovered the root of the problem: each operation in the OpenAPI specification needs to have its own operationId tag. Without this, AutoRest struggles to correctly map and generate the SDK methods. This was unexpected, especially since other SDK generators I’ve used didn’t require this level of specificity.&lt;/p&gt;

&lt;p&gt;While it caught me off guard, it’s not a showstopper. Adding unique operationId tags to the spec is a manageable fix, and once addressed, AutoRest should function as intended. It’s a small extra step, but one worth noting for anyone planning to use AutoRest with their OpenAPI specs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg7772oi0tefsn2uh28m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg7772oi0tefsn2uh28m.png" alt="Running AutoRest" width="800" height="522"&gt;&lt;/a&gt; &lt;em&gt;Running AutoRest&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With the operationId issue resolved, everything is back on track! The SDK has been successfully generated, and the output is neatly organized in the specified folder. We’re now ready to dive in, explore the generated files, and start integrating the SDK into our project. It’s great to see things running smoothly again!&lt;/p&gt;

&lt;p&gt;Next, we’re ready to test our newly generated SDK client by creating a simple script. However, here’s where another hiccup surfaced. While preparing the script, I realized that the SDK depends on additional Python packages — but this wasn’t mentioned anywhere in the documentation!&lt;/p&gt;

&lt;p&gt;To get the SDK client working properly, you’ll need to install the following dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install isodate
pip install azure-core
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, it’s time to test our generated SDK with a simple test script. However, before we can run the script, there’s one more dependency we need to address. Since the SDK is built with Microsoft’s ecosystem in mind, you’ll need to install the azure-identity package to handle authentication.&lt;/p&gt;

&lt;p&gt;You can do this easily by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install azure-identity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This package provides essential authentication methods, such as support for Azure Active Directory credentials, ensuring our SDK can securely connect to the API.&lt;/p&gt;

&lt;p&gt;While it’s another dependency to manage, it’s a necessary step to make the SDK functional. Once installed, we’ll be ready to dive into testing our script and seeing the SDK in action!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;RestQuotes&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;DuneQuotesAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.identity&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;DefaultAzureCredential&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DuneQuotesAPI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;credential&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;DefaultAzureCredential&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;quotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_quotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;quotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;character&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ==&amp;gt; #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;quote&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When it comes to documentation, I ran into a bit of a roadblock. Despite thoroughly exploring the available resources, I couldn’t find any clear instructions or guidance on how to generate documentation for the SDK.&lt;/p&gt;

&lt;p&gt;This lack of information can be frustrating, especially for developers who rely on good documentation to understand and utilize an SDK effectively. It’s something that stands out compared to other SDK generator tools, many of which either generate documentation automatically or provide a straightforward way to do so.&lt;/p&gt;

&lt;p&gt;If this feature exists, it’s not well-documented, which makes it harder to leverage the full potential of the generated SDK. Hopefully, future updates to the tool or its documentation will address this gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;After thoroughly testing various SDK generation tools, here are my key takeaways for each of them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fern&lt;/strong&gt;&lt;br&gt;
Hands down, one of the best experiences I had. The entire process — from SDK generation to testing and documentation — was seamless. Fern was quick, intuitive, and required no extra steps for documentation generation. While some might criticize the lack of a UI, I appreciate Fern’s simplicity through a CLI installed via NPM — it appeals to my inner developer who wants to get straight to the point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIMatic&lt;/strong&gt;&lt;br&gt;
The SDK creation process was smooth and straightforward, just a great experience. Generating both the SDKs and documentation in a single step made for an excellent user experience. I thoroughly enjoyed the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenAPI Generator&lt;/strong&gt;&lt;br&gt;
The SDK creation process was simple and intuitive. However, calling it from a test script wasn’t as smooth as I had hoped, requiring a bit of extra effort to get things working because the source code was a bit too complex for my taste. On the bright side, its documentation generation was solid and sufficient for most use cases as it’s an HTML page with all the information about the generated SDK, although without any formatting or design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stainless&lt;/strong&gt;&lt;br&gt;
The SDK generation process was smooth, and having the generated SDK pushed to GitHub, complete with usage examples, was a nice touch. It’s a private repo on their organization which can be transferred to a production repo of our own. However, I couldn’t find any documentation generated for the SDK, which was a bit disappointing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speakeasy&lt;/strong&gt;&lt;br&gt;
While I didn’t enjoy navigating through multiple screens during the setup process, the overall experience was straightforward. It took me some time to locate the generated documentation, but it was there in the end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kiota&lt;/strong&gt;&lt;br&gt;
Kiota required installing several additional Python packages, which felt unnecessarily complicated. Moreover, the structure of the test script wasn’t user-friendly for me, and the lack of documentation for the generated SDK was a significant downside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AutoRest&lt;/strong&gt;&lt;br&gt;
The issue with missing operationId tags in the OpenAPI spec caused some initial frustration and wasted time. However, once resolved, the process was smooth. Testing the generated SDK required an extra library installation, but this wasn’t a major obstacle. Unfortunately, like Kiota, I couldn’t find a way to generate documentation for the SDK.&lt;/p&gt;

</description>
      <category>api</category>
      <category>apidevelopment</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Nylas and AI: Email and Calendaring for the Future</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Mon, 28 Aug 2023 10:25:24 +0000</pubDate>
      <link>https://dev.to/nylas/nylas-and-ai-email-and-calendaring-for-the-future-pn4</link>
      <guid>https://dev.to/nylas/nylas-and-ai-email-and-calendaring-for-the-future-pn4</guid>
      <description>&lt;p&gt;Yes, we're hosting a Hackathon and you can &lt;a href="https://nylas.devpost.com/" rel="noopener noreferrer"&gt;join today&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj07hu17ukh4bw2ao5ds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj07hu17ukh4bw2ao5ds.png" alt="Nylas Hackathon" width="300" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What do I need to do?
&lt;/h2&gt;

&lt;p&gt;Just create an application using any of our SDKs (Ruby, NodeJS, Java, Python) or calling our APIs directly and any Artificial Intelligence tool of your choice (ChatGPT, Hugging Face, Midjourney).&lt;/p&gt;

&lt;h2&gt;
  
  
  Are there any prizes?
&lt;/h2&gt;

&lt;p&gt;Of course, here's the list for the first prize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;$5,000 USD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual meeting with Nylas leadership&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blog post featuring the winning submissions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here for the 5 runner ups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;$1,000 USD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual meeting with Nylas leadership&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blog post featuring the winning submissions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  I just signed up, now what?!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6fpycm4s826nzf3q5my.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6fpycm4s826nzf3q5my.jpeg" alt="Create a free Nylas account" width="702" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you sign up, you will receive an started kit email with clear instructions, but, if you don't read it or your forget about it, it's critical that you create a &lt;a href="https://dashboard.nylas.com/register?utm_source=devpost&amp;amp;utm_medium=hackathon&amp;amp;utm_campaign=devpost-hackathon-q3-23&amp;amp;utm_content=" rel="noopener noreferrer"&gt;free Nylas account&lt;/a&gt; (And mention that you are completing our Hackathon!), that will allow you to connect up to 10 email account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can I get some inspiration?
&lt;/h2&gt;

&lt;p&gt;Sure you can, just watch some of our &lt;strong&gt;Coding with Nylas&lt;/strong&gt; livestream episodes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foth7rw2ysnbezh1ksp20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foth7rw2ysnbezh1ksp20.png" alt="Coding with Nylas" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=xnp-7oW5cvw" rel="noopener noreferrer"&gt;How to Send an email using DearPyGUI, ChatGPT and your voice | Coding with Nylas | Episode 68&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=KNJWMGExt18" rel="noopener noreferrer"&gt;How to use AI to generate email responses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=00VLiNT7Tlw" rel="noopener noreferrer"&gt;Localize your emails with ChatGPT and Python | Coding with Nylas | Episode 59&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=InxpfTtGYf0" rel="noopener noreferrer"&gt;Python, Sentiment Analysis, Streamlit, and ChatGPT | Coding with Nylas | Episode 74&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=NzXTuJzdveE" rel="noopener noreferrer"&gt;Nylas + AI Events: WeAreDevelopers Recap &amp;amp; Upcoming Events&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Last words
&lt;/h2&gt;

&lt;p&gt;Just follow the foxes advise 😉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frs7gsv6o3t8jq3s5ngxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frs7gsv6o3t8jq3s5ngxb.png" alt="Join Nylas Hackathon" width="286" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>programming</category>
      <category>ai</category>
      <category>api</category>
    </item>
    <item>
      <title>A Small Introduction to Functional Programming</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Tue, 03 Jan 2023 20:48:02 +0000</pubDate>
      <link>https://dev.to/nylas/a-small-introduction-to-functional-programming-4aid</link>
      <guid>https://dev.to/nylas/a-small-introduction-to-functional-programming-4aid</guid>
      <description>&lt;p&gt;Functional Programming is an old paradigm that’s gained popularity in recent years due to its code conciseness, modularity, and lack of side effects.&lt;/p&gt;

&lt;p&gt;Based on &lt;a href="https://en.wikipedia.org/wiki/Lambda_calculus" rel="noopener noreferrer"&gt;Lambda Calculus&lt;/a&gt;, developed by Alonzo Church in the 1930s, functional programming has been implemented in mainstream programming languages like &lt;a href="https://www.javascript.com/" rel="noopener noreferrer"&gt;JavaScript&lt;/a&gt;, &lt;a href="https://www.python.org/" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://www.java.com/en/" rel="noopener noreferrer"&gt;Java&lt;/a&gt;. Programming languages like &lt;a href="https://www.erlang.org/" rel="noopener noreferrer"&gt;Erlang&lt;/a&gt;, &lt;a href="https://www.haskell.org/" rel="noopener noreferrer"&gt;Haskell&lt;/a&gt; or &lt;a href="https://www.scala-lang.org/" rel="noopener noreferrer"&gt;Scala&lt;/a&gt; are better suited for functional programming as they are designed to be functional first.&lt;/p&gt;

&lt;p&gt;Many developers consider &lt;a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)" rel="noopener noreferrer"&gt;Lisp&lt;/a&gt; the first functional programming language. For newer incarnations, we can try &lt;a href="https://lisp-lang.org/" rel="noopener noreferrer"&gt;Common Lisp&lt;/a&gt; or &lt;a href="https://racket-lang.org/" rel="noopener noreferrer"&gt;Racket&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What makes functional programming so unique?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Pure functions&lt;/strong&gt; → The same input always produces the same output, and there are no side effects (no printing into the screen, mutating your input or changing the filesystem).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function are First Class citizens&lt;/strong&gt; → Function are treated as data. We can use them as variables, as input for other functions or as return values. Functions are everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shorter code&lt;/strong&gt; → Programs written in functional programming languages tend to be shorter than its counterparts like object oriented or imperative programming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No loops&lt;/strong&gt; → There’s no while, for, do while or anything of the sort as recursion is all you need.&lt;/p&gt;

&lt;h1&gt;
  
  
  What do we need?
&lt;/h1&gt;

&lt;p&gt;In this post, we’re going to explore some key fundamentals of functional programming using examples in two different functional languages and you’re invited to install them both, or just install what you want or need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Haskell (1990 / Purely Functional)&lt;/strong&gt; → If we’re on a Mac, the best way is to use &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;homebrew&lt;/a&gt; and type on the terminal window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;ghc cabal-install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;strong&gt;ghc&lt;/strong&gt; is the &lt;strong&gt;Glasgow Haskell Compiler&lt;/strong&gt; and &lt;strong&gt;Cabal&lt;/strong&gt; is Haskell’s package manager.&lt;/p&gt;

&lt;p&gt;For other systems, you can refer to the &lt;a href="https://www.haskell.org/downloads/" rel="noopener noreferrer"&gt;download&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Erlang (1986 / Concurrent and Functional)&lt;/strong&gt; → Again, if on a Mac, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;erlang
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can refer to the &lt;a href="https://www.erlang.org/downloads" rel="noopener noreferrer"&gt;download&lt;/a&gt; page.&lt;/p&gt;

&lt;h1&gt;
  
  
  Immutable variables
&lt;/h1&gt;

&lt;p&gt;In functional programming, once a variable is assigned it can never change. You can think of that as using constants all the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Erlang
&lt;/h2&gt;

&lt;p&gt;In Erlang variables begin with an Uppercase letter and once assigned they cannot be changed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiza8lo3cypx3q5psnys1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiza8lo3cypx3q5psnys1.png" alt="Erlang Variables" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Haskell
&lt;/h2&gt;

&lt;p&gt;In Haskell variables don’t follow any structure. Create a file called &lt;strong&gt;variables.hs&lt;/strong&gt; and type the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight haskell"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open a terminal window on the same folder as your file and run &lt;strong&gt;ghci&lt;/strong&gt;, then &lt;strong&gt;:l variables&lt;/strong&gt; to load your program.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj20mrz91m5wcd47mmx43.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj20mrz91m5wcd47mmx43.png" alt="Haskell Variables" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Pattern Matching
&lt;/h1&gt;

&lt;p&gt;In short terms, pattern matching allows us to define how the same function will react to different parameters. This means that calling the function &lt;strong&gt;myFunction&lt;/strong&gt; with no parameters will be different from calling &lt;strong&gt;myFunction&lt;/strong&gt; with two parameters and different from calling it with five parameters and even different when calling it with different parameter values.&lt;/p&gt;

&lt;p&gt;Let’s create an Erlang example called &lt;strong&gt;greetings.erl&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight erlang"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;greetings&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;export&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;greet&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;
&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;male&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Good morning Mr. &lt;/span&gt;&lt;span class="si"&gt;~s~n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;female&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Good morning Mrs. &lt;/span&gt;&lt;span class="si"&gt;~s~n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(_,&lt;/span&gt; &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Good morning ???. &lt;/span&gt;&lt;span class="si"&gt;~s~n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run it, we can see that we can call the same function but using different parameters and it will always run as expected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus860gwik41wfe7rbuq2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus860gwik41wfe7rbuq2.png" alt="Erlang Greetings" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Anonymous functions
&lt;/h1&gt;

&lt;p&gt;Anonymous functions are functions that do not have a name. We can call them just once. We use them to define functions that are not meant to be called multiple times.&lt;/p&gt;

&lt;p&gt;Let’s see an example calling a function to manipulate a list. We’re going to write a file called &lt;strong&gt;lambdas.hs&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight haskell"&gt;&lt;code&gt;&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt;
&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;show_nums&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;show_nums&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to call the Haskell compiler to read our file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ghci 
&lt;span class="nv"&gt;$ &lt;/span&gt;:l lambdas.hs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then call it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;show_nums &lt;span class="o"&gt;[&lt;/span&gt;1,2,3,4,5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbu6a46yr2oaykm9kiufg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbu6a46yr2oaykm9kiufg.png" alt="Lambdas" width="800" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While this is simple, we don’t really need the &lt;strong&gt;func&lt;/strong&gt; function, so let’s change the source code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight haskell"&gt;&lt;code&gt;&lt;span class="n"&gt;show_lambdas&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;show_lambdas&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;\&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it will yield the same exact result, but with half the code lines:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnexaqgu6mersxj5c8e5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnexaqgu6mersxj5c8e5y.png" alt="Lambdas again" width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Closures
&lt;/h1&gt;

&lt;p&gt;A closure is a function inside a function that gets access to its parent function variables. Sounds strange, huh? Let’s see an Erlang example:&lt;/p&gt;

&lt;p&gt;We’re going to write this example on a file called &lt;strong&gt;closures.erl&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight erlang"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;closures&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;export&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;
&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
  &lt;span class="nv"&gt;GreetPerson&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello and welcome &lt;/span&gt;&lt;span class="si"&gt;~s&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="si"&gt;~n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
    &lt;span class="k"&gt;fun&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Goodbye &lt;/span&gt;&lt;span class="si"&gt;~s&lt;/span&gt;&lt;span class="s"&gt;. Nice to meet you.&lt;/span&gt;&lt;span class="si"&gt;~n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;Greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;GreetPerson&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nv"&gt;Greet&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run this we need to compile the file first by typing on the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;erlc closures.erl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;strong&gt;closures.beam&lt;/strong&gt; file gets generated, which is a file that will be interpreted by the Erlang VM.&lt;/p&gt;

&lt;p&gt;After compilation, we need to open the &lt;strong&gt;Erlang VM&lt;/strong&gt; and run it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;erl

&lt;span class="nv"&gt;$ &lt;/span&gt;closures:start&lt;span class="o"&gt;(&lt;/span&gt;“Blag”&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will run and execute our code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nk6o3kvtodfdwllz47w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nk6o3kvtodfdwllz47w.png" alt="Closures" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we can see that by calling &lt;strong&gt;Greet = GreetPerson()&lt;/strong&gt;, we’re assigning the function &lt;strong&gt;GreetPerson()&lt;/strong&gt; to the variable &lt;strong&gt;Greet&lt;/strong&gt;. When we call &lt;strong&gt;Greet()&lt;/strong&gt;, we’re greeting the person, but we’re also running an anonymous function that will say goodbye to the user. Notice that we’re not calling this anonymous function directly.&lt;/p&gt;

&lt;h1&gt;
  
  
  List Comprehensions
&lt;/h1&gt;

&lt;p&gt;List comprehensions are a way to build or modify lists, and it is worth mentioning that lists are the most used type in functional programming.&lt;/p&gt;

&lt;p&gt;Using list comprehensions, we could rewrite the lambdas example. This time, let’s use Erlang and create a file called &lt;strong&gt;list_comprehensions.erl&lt;/strong&gt; with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight erlang"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list_comprehensions&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="ni"&gt;export&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;
&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;List&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; 
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;X&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="nv"&gt;X&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="nv"&gt;List&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run this, it will return the same result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmwh8gbp9splzm4f85nx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmwh8gbp9splzm4f85nx.png" alt="List comprehensions" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Recursion
&lt;/h1&gt;

&lt;p&gt;When using Recursion, a function calls itself multiple times, and this is not a foreign topic on non-functional programming languages, but the way it’s implemented and used is for sure different.&lt;/p&gt;

&lt;p&gt;To make more sense of this, let’s see how a factorial source will look like in &lt;a href="https://www.ruby-lang.org/en/" rel="noopener noreferrer"&gt;Ruby&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can write the same on &lt;strong&gt;Haskell&lt;/strong&gt;, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight haskell"&gt;&lt;code&gt;&lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;
&lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code is shorter and simpler:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp11q087hf5jzd5d6i67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp11q087hf5jzd5d6i67.png" alt="Factorial" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that’s it for a small introduction to functional programming.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjno1njbsv0xxl1raupc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjno1njbsv0xxl1raupc.png" alt="Functional Programming" width="800" height="1153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like what you read but looking for some Nylas content, make sure to check our great selection of &lt;a href="https://www.nylas.com/blog/" rel="noopener noreferrer"&gt;blog posts&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Don’t miss the action, watch our LiveStream Coding with Nylas:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/NIB6eg_Zkew"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>haskell</category>
      <category>erlang</category>
      <category>functional</category>
    </item>
    <item>
      <title>Send and Read Emails Using Node-Red and the Nylas APIs</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Fri, 16 Dec 2022 15:54:17 +0000</pubDate>
      <link>https://dev.to/nylas/send-and-read-emails-using-node-red-and-the-nylas-apis-2g50</link>
      <guid>https://dev.to/nylas/send-and-read-emails-using-node-red-and-the-nylas-apis-2g50</guid>
      <description>&lt;p&gt;If you’re a regular reader of our DevRel blogs, you might know that we had published several blogs on how to send and read emails using Nylas SDKs for languages like &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-python-sdk/" rel="noopener noreferrer"&gt;Python&lt;/a&gt;, &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-ruby-sdk/" rel="noopener noreferrer"&gt;Ruby&lt;/a&gt;, &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-nylas-node-sdk/" rel="noopener noreferrer"&gt;NodeJS&lt;/a&gt; and &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-java-sdk-dev/" rel="noopener noreferrer"&gt;Java&lt;/a&gt;. We also have talked about using &lt;a href="https://www.youtube.com/watch?v=MteeGtWaK54&amp;amp;list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&amp;amp;index=6&amp;amp;t=735s" rel="noopener noreferrer"&gt;PHP&lt;/a&gt;,  &lt;a href="https://www.youtube.com/watch?v=7gqnMf15fAA&amp;amp;list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&amp;amp;index=7&amp;amp;t=836s" rel="noopener noreferrer"&gt;C#, and Rust&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, we’re going to learn how to send and read emails using &lt;a href="https://nodered.org" rel="noopener noreferrer"&gt;Node-Red&lt;/a&gt;, a low-code programming environment based on NodeJS, that is mostly used for IoT scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Node-Red
&lt;/h2&gt;

&lt;p&gt;We can use npm to install Node-Red by typing the following in the terminal window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nt"&gt;--unsafe-perm&lt;/span&gt; node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If you’re on Windows, don’t use sudo.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once installed, we can simply call it from the terminal like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjioa270zgidg8n38ib5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjioa270zgidg8n38ib5.png" alt="Running Node-Red" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And it will run the editor on the following address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://127.0.0.1:1880/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Node-Red environment
&lt;/h2&gt;

&lt;p&gt;Being a visual environment, we can simply drag and drop elements into the canvas, and connect them via wires:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpwqy75xqj3lw2prcfaj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpwqy75xqj3lw2prcfaj.png" alt="Node-Red example" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Nodes
&lt;/h2&gt;

&lt;p&gt;In Node-Red, we can install additional &lt;strong&gt;Nodes&lt;/strong&gt; that will help us in making our work easier.&lt;/p&gt;

&lt;p&gt;We’re going to install &lt;a href="https://flows.nodered.org/node/node-red-contrib-sysmessage" rel="noopener noreferrer"&gt;sysmessage&lt;/a&gt;, a node that will allow us to create notifications in a simple and easy way.&lt;/p&gt;

&lt;p&gt;First, we need to press the menu button on the right hand side:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx2q397nfzqzu5erlgli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx2q397nfzqzu5erlgli.png" alt="Deploy Nodes" width="762" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select &lt;strong&gt;Manage Palette&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd7b8hiozgg3nld3h6ir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd7b8hiozgg3nld3h6ir.png" alt="Manage Palette" width="583" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, on the &lt;strong&gt;Install&lt;/strong&gt; tab, type &lt;strong&gt;sysm&lt;/strong&gt; (to bring up autocompletion) on the search box and click on &lt;strong&gt;Install&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felm1vh5vzshxj3cnt6rn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felm1vh5vzshxj3cnt6rn.png" alt="sysmessage package" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installed, a new node will appear on the left section on our canvas:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88o98tqt23g1ayvpv1ik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88o98tqt23g1ayvpv1ik.png" alt="sysmessage installed" width="350" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending an email
&lt;/h2&gt;

&lt;p&gt;Now, we’re ready to send our email.&lt;/p&gt;

&lt;p&gt;First, we’re going to select an Inject node and drag it into the canvas:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39bc0vpw9q94lplx8zjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39bc0vpw9q94lplx8zjs.png" alt="Inject node" width="358" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With a double click, we can access its properties. We want to delete the &lt;strong&gt;msg.topic&lt;/strong&gt; message:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1m73gu064rqj1d9cgxoj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1m73gu064rqj1d9cgxoj.png" alt="define msg.topic" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to choose &lt;strong&gt;timestamp&lt;/strong&gt; and change it for &lt;strong&gt;JSON&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw60jvxs1wsy72v6i6lz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw60jvxs1wsy72v6i6lz.png" alt="JSON payload" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, select the three points to expand the editor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficak8m00v9xuyghxlvfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficak8m00v9xuyghxlvfy.png" alt="Expands JSON editor" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And paste the following JSON code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello from Node-Red"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
           &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"devrel@nylas.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
           &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Nylas' DevRel Team"&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This email was sent using Node-Red and the Nylas APIs."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we’re going to drag an http request node:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkg4q35yubzhv34wa8bo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkg4q35yubzhv34wa8bo.png" alt="http request node" width="360" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we need to change the Method to &lt;strong&gt;POST&lt;/strong&gt; and pass the Nylas Send Endpoint which is &lt;strong&gt;&lt;a href="https://api.nylas.com/send" rel="noopener noreferrer"&gt;https://api.nylas.com/send&lt;/a&gt;&lt;/strong&gt;. Then, we need to tick on &lt;strong&gt;Use authentication&lt;/strong&gt; and select &lt;strong&gt;bearer authentication&lt;/strong&gt; and pass our access token. Lastly, we need to add a couple of headers, &lt;strong&gt;Accept&lt;/strong&gt; and &lt;strong&gt;Content-Type&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcuabgkwgz24oqoqpo2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcuabgkwgz24oqoqpo2q.png" alt="Configure http request" width="800" height="990"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once that’s done, we need to drag and add the &lt;strong&gt;sysmessage&lt;/strong&gt; node and configure it like this; Choose the type of alert, OSX Alert in this case, and add an appropriate title. Leave the rest as it is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmksmyluvgtgrw1ussgi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmksmyluvgtgrw1ussgi.png" alt="Configure Sysmessage" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect all the nodes with wires so it will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsm6b4aagwbxjiw7kz536.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsm6b4aagwbxjiw7kz536.png" alt="Send email layout" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or, you can simply copy and paste the following &lt;a href="https://gist.github.com/atejada/55ad2a61c57545750acf864deb896917" rel="noopener noreferrer"&gt;JSON code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Paste the JSON code and press &lt;strong&gt;Import&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj67cta6gm4qp8q1ojvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj67cta6gm4qp8q1ojvb.png" alt="JSON Email Send Code" width="800" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We should have all &lt;strong&gt;nodes&lt;/strong&gt; ready to be pasted. Once we finish, we can press the &lt;strong&gt;Deploy&lt;/strong&gt; button, which is located next to the menu button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5x3o5on4r75ptn0qpe0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5x3o5on4r75ptn0qpe0.png" alt="Deploy nodes" width="762" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once deployed, we just need to press the Inject note in order to send the email and get the notification message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj61ueuazvblqlr4l7uwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj61ueuazvblqlr4l7uwl.png" alt="Click inject send email" width="800" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, we will get the JSON response back from calling the Nylas API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhn8tp7yqbi4lpiwhbh0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhn8tp7yqbi4lpiwhbh0.png" alt="Send email response" width="565" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With minimal effort and no code, we sent an email using Node-Red and the Nylas APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading Emails
&lt;/h2&gt;

&lt;p&gt;Sending email was simple and almost straightforward, but reading email gets a little bit complicated. No worries, it will be fun.&lt;/p&gt;

&lt;p&gt;First, we’re going to create an http in node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxrrgcyfhd84n74cdinc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxrrgcyfhd84n74cdinc.png" alt="http in node" width="344" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And configure it like this:&lt;/p&gt;

&lt;p&gt;The method is &lt;strong&gt;GET&lt;/strong&gt;, the &lt;strong&gt;URL&lt;/strong&gt; will include &lt;strong&gt;/:limit&lt;/strong&gt; which is going to how many emails we want to fetch and the &lt;strong&gt;Name&lt;/strong&gt; is actually optional.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpoynm2xln53orrygwmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpoynm2xln53orrygwmu.png" alt="define GetEmails with limit" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also add an extra http in node and get the URL but without the /:limit as this will help us to define a default page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ov2hy7mdvlxqd5zkqvl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ov2hy7mdvlxqd5zkqvl.png" alt="define GetEmails without limit" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’re going to add a Change node. This will allow us to read the /:limit parameter from before.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdb187eo18xbm2ek757x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdb187eo18xbm2ek757x.png" alt="change node" width="358" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The name is optional, but the SET and to the value are very important. We’re getting the parameter value and assigning it to the payload.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F481rn36u5zbrf3xogmh0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F481rn36u5zbrf3xogmh0.png" alt="change payload" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This parameter is going to be a String, but we need an Integer. So, we need to add a Function node and type the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvj891zv7jiorm1mc5cj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvj891zv7jiorm1mc5cj.png" alt="Function node" width="358" height="352"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
   &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will simply check if we are passing or not the &lt;strong&gt;:limit&lt;/strong&gt; parameter and if we’re not, pass &lt;strong&gt;5&lt;/strong&gt; as the limit, then it will convert the &lt;strong&gt;String&lt;/strong&gt; parameter to an &lt;strong&gt;Integer&lt;/strong&gt; parameter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumhpap3bk1h9scvh9ubt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumhpap3bk1h9scvh9ubt.png" alt="To number function" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step will be to add an &lt;strong&gt;http request&lt;/strong&gt; node. It will be the same as &lt;strong&gt;Sending an email&lt;/strong&gt; but the URL would be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.nylas.com/messages?in=inbox&amp;amp;limit={{{payload}}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 and the return will be a &lt;strong&gt;parsed JSON object&lt;/strong&gt; instead of a &lt;strong&gt;UTF-8 String&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z7132ywa8suwsio5vz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z7132ywa8suwsio5vz7.png" alt="Define read email as JSON" width="704" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the URL,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**https://api.nylas.com/messages?in=inbox&amp;amp;limit={{{payload}}}**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 the &lt;strong&gt;in=inbox&lt;/strong&gt; part means that we’re reading mail coming from the inbox only, and the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**limit={{{payload}}}**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 means that the amount of emails that we want to fetch would be the same as the number we used as parameter.&lt;/p&gt;

&lt;p&gt;We’re going to get back an array of emails, and we need to access them one by one, so our best choice is to use the &lt;strong&gt;split&lt;/strong&gt; node:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuwi4qea90oqtojd9v82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuwi4qea90oqtojd9v82.png" alt="split node to split the array of emails" width="350" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This node will grab each item in the array of emails. What we want to do is to change the format of the date field, as it is currently displayed as &lt;strong&gt;Epoch&lt;/strong&gt; (number of seconds since January 01, 1970) and we want something more human readable. The best thing is that we don’t need to modify any property of this node; we can use it just as it comes.&lt;/p&gt;

&lt;p&gt;This is the code for the function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ppdrpoe7m1rjz2a4mey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ppdrpoe7m1rjz2a4mey.png" alt="Change the format" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we’re done fixing the dates, it’s time to make the elements an array again, and for that we need to use the &lt;strong&gt;join&lt;/strong&gt; node, which in the same manner as &lt;strong&gt;split&lt;/strong&gt;, can be used without any further modifications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjid2z9bdpyu9lugos8wb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjid2z9bdpyu9lugos8wb.png" alt="Join node" width="358" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the array is ready and back in place, we need to display the information from the emails, and for that we can use the &lt;strong&gt;template&lt;/strong&gt; node. This node uses the &lt;a href="https://mustache.github.io" rel="noopener noreferrer"&gt;mustache&lt;/a&gt; system, which is a logicless template engine for creating dynamic content. In other words, it generates HTML code by using tags that are replaced by code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc6n3v8e7b4v8l1jehs2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc6n3v8e7b4v8l1jehs2.png" alt="Template node to display emails inbox" width="356" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the code that we will need to use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.tailwindcss.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-black"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-align:center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Inbox&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"table-auto"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Subject&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;From (Name)&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;From (Email)&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Date&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Snippet&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
   {{#payload}}
   &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
   {{subject}}
   &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
   {{from.0.name}}
   &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
   {{from.0.email}}
   &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;   
   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
   {{date}}
   &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;   
   &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
   {{snippet}}
   &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
   {{/payload}}
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will simply create a table, loop each record of the array and print out the subject, name and email of sender, date and the snippet (email preview).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm93f3u28xff6nfao6v37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm93f3u28xff6nfao6v37.png" alt="Define payload template" width="604" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last piece is the http response node which will allow us to see the template on the web browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46zzwqxmnb74957jutle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46zzwqxmnb74957jutle.png" alt="http response node" width="358" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We don’t need to change anything on this node.&lt;/p&gt;

&lt;p&gt;Once we click on &lt;strong&gt;Deploy&lt;/strong&gt;, we can start testing.&lt;/p&gt;

&lt;p&gt;Our canvas should look like this one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5avh1fhngn1te734knu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5avh1fhngn1te734knu.png" alt="Read emails layout" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And of course, we can import the following &lt;a href="https://gist.github.com/atejada/a42461a3aafb929c5d04ecc9e7b43f40" rel="noopener noreferrer"&gt;JSON code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On our browser of choice, we need to navigate to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://localhost:1880/GetEmails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we will get the first five emails in our inbox:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbyqcp2ui1e85zz08w35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbyqcp2ui1e85zz08w35.png" alt="Read first five emails" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And we can also pass parameters, so calling it this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://localhost:1880/GetEmails/1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will fetch just one email.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vxxigz3n25hlzgz6qpt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vxxigz3n25hlzgz6qpt.png" alt="Read just one image" width="800" height="67"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can choose any number from one to one hundred (as that’s currently the fetch limit).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57quncstomq7w1ewuem9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57quncstomq7w1ewuem9.png" alt="Read three emails" width="800" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that’s it. Hope you like this one. Sending and reading emails using Node-Red and the Nylas APIs is both fast and easy.&lt;/p&gt;

&lt;p&gt;If you want to learn more about email management with Nylas, visit our documentation page &lt;a href="https://developer.nylas.com/docs/connectivity/email/" rel="noopener noreferrer"&gt;Email API Overview&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Watch the &lt;a href="https://www.youtube.com/watch?v=zxsiXHAPffQ" rel="noopener noreferrer"&gt;Coding with Nylas episode 18 - Send and Read emails using Node-Red&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>node</category>
      <category>api</category>
      <category>iot</category>
    </item>
    <item>
      <title>How to Send an Email in Any Language Using the Nylas APIs</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Wed, 14 Dec 2022 08:49:31 +0000</pubDate>
      <link>https://dev.to/nylas/how-to-send-an-email-in-any-language-using-the-nylas-apis-5c47</link>
      <guid>https://dev.to/nylas/how-to-send-an-email-in-any-language-using-the-nylas-apis-5c47</guid>
      <description>&lt;p&gt;If you’ve been reading our posts, then you know how to send emails using &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-ruby-sdk/" rel="noopener noreferrer"&gt;Ruby&lt;/a&gt;, &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-python-sdk/" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-nylas-node-sdk/" rel="noopener noreferrer"&gt;Node&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But you may be wondering, can I use something else? Can I use PHP, Rust or C#?&lt;/p&gt;

&lt;p&gt;Well, the simple answer is yes, we absolutely can. Nylas provides APIs, not only SDKs, so we can use any available programming language that supports Rest API calls.&lt;/p&gt;

&lt;p&gt;We’re going to display some examples and take them more as a proof-of-concept than real applications. There are several ways to consume APIs and the intention of this blog post is just to show one way of doing that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending an Email using PHP and Nylas Apis
&lt;/h2&gt;

&lt;p&gt;First, we need to have &lt;a href="https://www.php.net" rel="noopener noreferrer"&gt;PHP&lt;/a&gt; installed as well as &lt;a href="https://getcomposer.org" rel="noopener noreferrer"&gt;Composer&lt;/a&gt; (A dependency manager for PHP). Using Composer, we need to install &lt;a href="https://github.com/vlucas/phpdotenv" rel="noopener noreferrer"&gt;dotenv&lt;/a&gt; which will allow us to read .env files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;composer require vlucas/phpdotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the .env file we need to pass our access token that we can easily gather from the &lt;a href="https://dashboard.nylas.com" rel="noopener noreferrer"&gt;Nylas Dashboard&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ACCESS_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;access_token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we can create our script and call it &lt;strong&gt;SendEmail.php&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="c1"&gt;# Import your dependencies&lt;/span&gt;
&lt;span class="k"&gt;require_once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'vendor/autoload.php'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;# Load env variables&lt;/span&gt;
&lt;span class="nv"&gt;$dotenv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Dotenv\Dotenv&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;createImmutable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;__DIR__&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$dotenv&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize variables&lt;/span&gt;
&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;# If we're working with a POST method&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_SERVER&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"REQUEST_METHOD"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;# Required fields for Email API&lt;/span&gt;
&lt;span class="nv"&gt;$fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s1"&gt;'subject'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'body'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'to'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
                 &lt;span class="s1"&gt;'name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"to_name"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                 &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"to_email"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;]),&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;  

&lt;span class="c1"&gt;# Headers with Authorization and type&lt;/span&gt;
&lt;span class="nv"&gt;$headr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$headr&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Accept: application/json'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$headr&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Content-type: application/json'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$headr&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Authorization: Bearer '&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$_ENV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'ACCESS_TOKEN'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;# Call the Send Email API&lt;/span&gt;
&lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;"https://api.nylas.com/send"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Encode the data as JSON&lt;/span&gt;
&lt;span class="nv"&gt;$payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$fields&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Submit the Email information&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POSTFIELDS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Submit the Headers&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_HTTPHEADER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$headr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# We're doing a POST&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Return response instead of printing.&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Send request.&lt;/span&gt;
&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;# Close request&lt;/span&gt;
&lt;span class="nb"&gt;curl_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Create the Form --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Send an Email using PHP and the Nylas APIs&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nb"&gt;htmlspecialchars&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_SERVER&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"PHP_SELF"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    To Name: &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"to_name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
    To Email: &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"to_email"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;    
    Subject: &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"subject"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
    Body: &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"body"&lt;/span&gt; &lt;span class="na"&gt;rows=&lt;/span&gt;&lt;span class="s"&gt;"5"&lt;/span&gt; &lt;span class="na"&gt;cols=&lt;/span&gt;&lt;span class="s"&gt;"40"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;  

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of saving this on our Apache folder, we will keep it where our PHP scripts reside and simply type this on the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;php &lt;span class="nt"&gt;-S&lt;/span&gt; 127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will call PHP’s internal web server. Going to our favourite browser we can pass the following address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://localhost:8000/SendEmail.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a form will be displayed:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl9c0a0zwqgy2a598h3r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl9c0a0zwqgy2a598h3r.png" alt="PHP Email Form" width="800" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to fill in the recipient’s name, the recipient’s email, the subject and the body of the email. Once we press Submit, we will get a raw response indicating that everything was fine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8of011143068vps8ak3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8of011143068vps8ak3.png" alt="PHP Email Delivered" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The email was successfully delivered.&lt;/p&gt;

&lt;p&gt;You can check the Github repo &lt;a href="https://github.com/nylas-samples/php_send_and_read_emails" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can watch the LiveStream video &lt;a href="https://www.youtube.com/watch?v=MteeGtWaK54&amp;amp;list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&amp;amp;index=6&amp;amp;t=750s" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending an Email using Rust and Nylas Apis
&lt;/h2&gt;

&lt;p&gt;Next, let’s use &lt;a href="https://www.rust-lang.org" rel="noopener noreferrer"&gt;Rust&lt;/a&gt;. We’re going to use Cargo (Rust’s Dependency Manager) which is bundled inside Rust.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;cargo new send_email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create two different files. The first one called &lt;strong&gt;Cargo.toml&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[package]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"send_email"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="py"&gt;edition&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"2021"&lt;/span&gt;

&lt;span class="c"&gt;# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html&lt;/span&gt;

&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;reqwest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.11"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"json"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c"&gt;# reqwest with JSON parsing support&lt;/span&gt;
&lt;span class="py"&gt;futures&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.3"&lt;/span&gt; &lt;span class="c"&gt;# for our async / await blocks&lt;/span&gt;
&lt;span class="py"&gt;tokio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.12.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"full"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c"&gt;# for our async runtime&lt;/span&gt;
&lt;span class="py"&gt;serde_json&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.0"&lt;/span&gt; &lt;span class="c"&gt;#to handle json&lt;/span&gt;
&lt;span class="py"&gt;dotenv&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.15.0"&lt;/span&gt; &lt;span class="c"&gt;# for reading .env file&lt;/span&gt;

&lt;span class="nn"&gt;[profile.release]&lt;/span&gt;
&lt;span class="py"&gt;opt-level&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'z'&lt;/span&gt;     &lt;span class="c"&gt;# Optimize for size.&lt;/span&gt;
&lt;span class="py"&gt;lto&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;          &lt;span class="c"&gt;# Enable Link Time Optimization&lt;/span&gt;
&lt;span class="py"&gt;codegen-units&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;   &lt;span class="c"&gt;# Reduce the number of codegen units to increase optimizations.&lt;/span&gt;
&lt;span class="py"&gt;panic&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'abort'&lt;/span&gt;     &lt;span class="c"&gt;# Abort on panic&lt;/span&gt;
&lt;span class="py"&gt;strip&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;        &lt;span class="c"&gt;# Strip symbols from binary*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second one called &lt;strong&gt;main.rs&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Import your dependencies&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;reqwest&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//HTTP Client&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;serde_json&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//Json handler&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// tokio let's us use "async" on our main function&lt;/span&gt;
&lt;span class="nd"&gt;#[tokio::main]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="c1"&gt;// Read the .env file&lt;/span&gt;
&lt;span class="nn"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Failed to read .env file"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Add the ACCESS_TOKEN to the Authorization string&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_access_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;_access_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bearer "&lt;/span&gt;&lt;span class="nf"&gt;.to_owned&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;  &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Not found"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Request the parameters&lt;/span&gt;
&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter a subject: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.read_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_subject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
             &lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"failed to read"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter a name: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.read_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"failed to read"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter an email: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.read_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"failed to read"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter the body: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;              
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nn"&gt;io&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.read_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;_body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"failed to read"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;trim_subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_subject&lt;/span&gt;&lt;span class="nf"&gt;.trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;trim_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="nf"&gt;.trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;trim_email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_email&lt;/span&gt;&lt;span class="nf"&gt;.trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;trim_body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_body&lt;/span&gt;&lt;span class="nf"&gt;.trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Create the JSON structure&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;_fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;json!&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="s"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;trim_subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="s"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;trim_email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;trim_name&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="s"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;trim_body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;reqwest&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//Create HTTP client&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="c1"&gt;//Call API passing parameters&lt;/span&gt;
        &lt;span class="nf"&gt;.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://api.nylas.com/send"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_access_token&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="nf"&gt;.header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Content-type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Accept"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;_fields&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.send&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;.await&lt;/span&gt;
        &lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Give the back the result of panic if it fails&lt;/span&gt;
        &lt;span class="nf"&gt;.text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Convert it to plain text&lt;/span&gt;
        &lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We must not forget to create the &lt;strong&gt;.env&lt;/strong&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ACCESS_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;access_token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we have everything, we need to release our application by typing on the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once it’s has been built:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./send_email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1bwa9o27p7hj5joc66y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1bwa9o27p7hj5joc66y.png" alt="Rust Sent Email" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just like in the PHP example, the email was successfully delivered.&lt;/p&gt;

&lt;p&gt;You can check the Github repo &lt;a href="https://github.com/nylas-samples/send_emails_rust_csharp" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can watch the LiveStream video &lt;a href="https://www.youtube.com/watch?v=7gqnMf15fAA&amp;amp;list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&amp;amp;index=7&amp;amp;t=863s" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending an Email using C# and Nylas Apis
&lt;/h2&gt;

&lt;p&gt;Finally, we’re going to use &lt;a href="https://dotnet.microsoft.com/en-us/languages/csharp" rel="noopener noreferrer"&gt;C#&lt;/a&gt;. And for this, we’re going to need to install &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To start, let’s head to our Terminal and type the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;send_email &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;send_email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we created a new folder and entered that folder, we need to type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dotnet new console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That will create the following files: &lt;strong&gt;Program.cs&lt;/strong&gt; and &lt;strong&gt;send_email.csproj&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to open Visual Studio Code and press &lt;strong&gt;Open&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmgmpb4dceav292m0p0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmgmpb4dceav292m0p0l.png" alt="VSCode Open File" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, choose your folder send_email and open it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qvudfqbzr4w59iwwvw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qvudfqbzr4w59iwwvw1.png" alt="VSCode choose folder" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will open up the editor and your files.&lt;/p&gt;

&lt;p&gt;On &lt;strong&gt;send_email.csproj&lt;/strong&gt; we need to include the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Project Sdk="Microsoft.NET.Sdk"&amp;gt;

 &amp;lt;PropertyGroup&amp;gt;
   &amp;lt;OutputType&amp;gt;Exe&amp;lt;/OutputType&amp;gt;
   &amp;lt;TargetFramework&amp;gt;net6.0&amp;lt;/TargetFramework&amp;gt;
   &amp;lt;ImplicitUsings&amp;gt;enable&amp;lt;/ImplicitUsings&amp;gt;
   &amp;lt;Nullable&amp;gt;enable&amp;lt;/Nullable&amp;gt;
 &amp;lt;/PropertyGroup&amp;gt;

 &amp;lt;ItemGroup&amp;gt;
   &amp;lt;PackageReference Include="DotNetEnv" Version="2.3.0" /&amp;gt;
   &amp;lt;PackageReference Include="RestSharp" Version="106.15" /&amp;gt;
 &amp;lt;/ItemGroup&amp;gt;

&amp;lt;/Project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;RestSharp&lt;/strong&gt; package will help us to consume REST APIs and the &lt;strong&gt;DotNetEnv&lt;/strong&gt; will help us read &lt;strong&gt;.env&lt;/strong&gt; files&lt;/p&gt;

&lt;p&gt;This is the code for the &lt;strong&gt;Program.cs&lt;/strong&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Import packages&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;RestSharp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Load .env file&lt;/span&gt;
&lt;span class="n"&gt;DotNetEnv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;DotNetEnv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TraversePath&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;Load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Ask via the user via console&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter subject:"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_subject&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter name:"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter email:"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter body:"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_body&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// Create a new Rest Client and call the Nylas API endpoint&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;RestSharp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RestClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://api.nylas.com/send"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Wait until the connection is done&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Timeout&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// We want a POST method&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;RestSharp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RestRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Adding header and authorization&lt;/span&gt;
&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Bearer "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// Formatting the body of our request&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;@"{"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;$@"    ""body"" : ""&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_body&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"","&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;$@"    ""subject"": ""&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_subject&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"","&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;$@"    ""to"": ["&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;@"        {"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;$@"            ""name"": ""&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"","&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;$@"            ""email"": ""&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_email&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"""&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;@"        }"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;@"    ]"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\n"&lt;/span&gt;
   &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;@"}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Adding the body as a parameter&lt;/span&gt;
&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddParameter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ParameterType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RequestBody&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// We send the request&lt;/span&gt;
&lt;span class="n"&gt;IRestResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Print the response&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Wait for user input before closing the terminal&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Read&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We must not forget to create the &lt;strong&gt;.env&lt;/strong&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ACCESS_TOKEN &lt;span class="o"&gt;=&lt;/span&gt; access_token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we have everything, we need to release our application by running it without debugging:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5l61402snmft781e7t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5l61402snmft781e7t3.png" alt="Run without debugging" width="800" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will generate an executable file that we can execute by going to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;bin/Debug/net6.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And running the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./send_email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feavsl35htvmxu62o5aex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feavsl35htvmxu62o5aex.png" alt="CSharp Email Sent" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just like in the PHP and Rust examples, the email was successfully delivered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0487rndxc7xsoaw5aag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0487rndxc7xsoaw5aag.png" alt="Email received" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check the Github repo &lt;a href="https://github.com/nylas-samples/send_emails_rust_csharp" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can check the Github repo &lt;a href="https://www.youtube.com/watch?v=7gqnMf15fAA&amp;amp;list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&amp;amp;index=7&amp;amp;t=863s" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want to learn more about our Email API, please go to our &lt;a href="https://developer.nylas.com/docs/connectivity/email/" rel="noopener noreferrer"&gt;Email API documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>rust</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Grouping Email Threads with Ruby and Nylas</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Fri, 09 Dec 2022 11:56:52 +0000</pubDate>
      <link>https://dev.to/nylas/grouping-email-threads-with-ruby-and-nylas-khc</link>
      <guid>https://dev.to/nylas/grouping-email-threads-with-ruby-and-nylas-khc</guid>
      <description>&lt;p&gt;Looking for emails is straightforward, however, trying to get them all in a single place with less noise can be a difficult task. Thanks to the Nylas Ruby API, we can make email threading possible.&lt;/p&gt;

&lt;p&gt;If you want to learn more about Email Threads, read the blog post &lt;a href="https://www.nylas.com/blog/how-to-make-email-threading-less-chaotic/" rel="noopener noreferrer"&gt;Stay Threaded: How to Manage and Control Email Threads&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Is your system ready to group email threads?
&lt;/h2&gt;

&lt;p&gt;If you already have the Nylas Ruby SDK installed and your Ruby environment is configured, then continue along with the blog.&lt;/p&gt;

&lt;p&gt;Otherwise, I would recommend that you read the post &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-ruby-sdk/" rel="noopener noreferrer"&gt;How to Send Emails with the Nylas Ruby SDK&lt;/a&gt; where the basic setup is explained.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are we going to talk about?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What does our application look like?&lt;/li&gt;
&lt;li&gt;Installing the Sinatra package&lt;/li&gt;
&lt;li&gt;Running our Email Threading application&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What does our application look like?
&lt;/h2&gt;

&lt;p&gt;Before we jump into the code, let’s see how our application actually works. We will have a single input field accepting the email address to get all the related email threads and messages included in those threads:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbgk9ub0y0u0fna12w5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbgk9ub0y0u0fna12w5y.png" alt="Email Threading Header" width="800" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’re going to list all email threads related to the address we used, as long as they have at least two messages:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwl7mgt2n6cp1uuegdgy4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwl7mgt2n6cp1uuegdgy4.png" alt="Email Threading Threads" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The email threads are presented in an accordion, and when we open one, we will get the emails in a sequence, with the contact image and with the noise removed. So no emails, phone numbers or reply texts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca49xrpfh1fjlq7z2q0k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca49xrpfh1fjlq7z2q0k.png" alt="Email Threading Conversation" width="800" height="702"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see, both simple and nice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing the Sinatra package
&lt;/h2&gt;

&lt;p&gt;To create a Ruby web application, our best option is to use &lt;a href="http://sinatrarb.com" rel="noopener noreferrer"&gt;Sinatra&lt;/a&gt;, one of the most popular Micro Frameworks in the Ruby world. We might need to install some additional gems:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ gem install sinatra&lt;br&gt;
$ gem install puma&lt;br&gt;
$ gem install nokogiri&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once installed, we’re ready to go:&lt;/p&gt;

&lt;p&gt;First, we’re going to create a folder called EmailThreading, and inside we’re going to create two folders, one called views and other called public.&lt;/p&gt;

&lt;p&gt;Let’s create a file called &lt;strong&gt;EmailThreading.rb&lt;/strong&gt; in the &lt;strong&gt;EmailThreading&lt;/strong&gt; folder, and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Import your dependencies&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'dotenv/load'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'nylas'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'sinatra'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'nokogiri'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'date'&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize your Nylas API client&lt;/span&gt;
&lt;span class="n"&gt;nylas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Nylas&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;API&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="ss"&gt;app_id: &lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CLIENT_ID"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="ss"&gt;app_secret: &lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CLIENT_SECRET"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="ss"&gt;access_token: &lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Use the Nokogiri gem to clean up the email response&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clean_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw_html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw_html&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'UTF-8'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;invalid: :replace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;undef: :replace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                         &lt;span class="ss"&gt;replace: &lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;universal_newline: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\P{ASCII}/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                         &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Nokogiri&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;HTML&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;Encoding&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;UTF_8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'//script'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'//style'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'//text()'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:text&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;br&amp;gt; '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# Get the contact associated to the email address&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_contact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;email: &lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# Download the contact picture if it's not stored already&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;download_contact_picture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
        &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;picture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;picture&lt;/span&gt;
        &lt;span class="n"&gt;file_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;".png"&lt;/span&gt;
        &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"public/"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;file_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;"wb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
            &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;picture&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'rb'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# When calling the application for the first time&lt;/span&gt;
&lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;_threads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="c1"&gt;# Call the page&lt;/span&gt;
    &lt;span class="n"&gt;erb&lt;/span&gt; &lt;span class="ss"&gt;:main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:locals&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:threads&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_threads&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# When asking for the email threading&lt;/span&gt;
&lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="s1"&gt;'/search'&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="c1"&gt;# Get parameter from form&lt;/span&gt;
    &lt;span class="n"&gt;search&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:search&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="c1"&gt;# Search all threads related to the email address   &lt;/span&gt;
    &lt;span class="n"&gt;threads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;threads&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;from: &lt;/span&gt;&lt;span class="n"&gt;search&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;in: &lt;/span&gt;&lt;span class="s1"&gt;'inbox'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

    &lt;span class="n"&gt;_threads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="c1"&gt;# Loop through all the threads  &lt;/span&gt;
    &lt;span class="n"&gt;threads&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
        &lt;span class="n"&gt;_thread&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="n"&gt;_messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="n"&gt;_pictures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="n"&gt;_names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="c1"&gt;# Look for threads with more than 1 message     &lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;message_ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="c1"&gt;# Get the subject of the first email        &lt;/span&gt;
            &lt;span class="n"&gt;_thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="c1"&gt;# Loop through all messages contained in the thread&lt;/span&gt;
            &lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;message_ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
                &lt;span class="c1"&gt;# Get information from the message          &lt;/span&gt;
                &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="c1"&gt;# Try to get the contact information                &lt;/span&gt;
                &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_contact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
                    &lt;span class="c1"&gt;# If the contact is available, downloads its profile picture&lt;/span&gt;
                    &lt;span class="n"&gt;download_contact_picture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nylas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;end&lt;/span&gt;
                &lt;span class="c1"&gt;# Remove extra information from the message, like appended &lt;/span&gt;
                &lt;span class="c1"&gt;#  message, email and phone number&lt;/span&gt;
                &lt;span class="n"&gt;_messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clean_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;body&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
                    &lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/(\bOn.*\b)(?!.*\1)/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
                    &lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,3}\b/i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
                    &lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
                    &lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/twitter:.+/i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
                    &lt;span class="c1"&gt;# Convert date to something readable&lt;/span&gt;
                    &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;
                    &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\d{4}-\d{2}-\d{2}/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\d{2}:\d{2}:\d{2}/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
                        &lt;span class="n"&gt;_pictures&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"NotFound.png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="n"&gt;_names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Not Found"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" on "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" at "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
                                    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
                    &lt;span class="k"&gt;else&lt;/span&gt;
                        &lt;span class="c1"&gt;# If there's a contact, pass picture information, &lt;/span&gt;
                        &lt;span class="c1"&gt;# name and date and time of message&lt;/span&gt;
                        &lt;span class="n"&gt;_pictures&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;".png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="n"&gt;_names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;given_name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;surname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
                                    &lt;span class="s2"&gt;" on "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" at "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
                    &lt;span class="k"&gt;end&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="n"&gt;_thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;_thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_pictures&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;_thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_names&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;_threads&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_thread&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# Call the page and display threads &lt;/span&gt;
    &lt;span class="n"&gt;erb&lt;/span&gt; &lt;span class="ss"&gt;:main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:locals&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:threads&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_threads&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the &lt;strong&gt;views&lt;/strong&gt; folder, we need to create two different files, let’s start with &lt;strong&gt;layout.erb&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Call the TailwindCSS and Flowbite libraries --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.tailwindcss.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/flowbite@1.5.3/dist/flowbite.min.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Nylas’ Email Threading&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;yield&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/flowbite@1.5.3/dist/flowbite.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’re calling both the &lt;a href="https://tailwindcss.com" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt; and &lt;a href="https://flowbite.com" rel="noopener noreferrer"&gt;Flowbite&lt;/a&gt; libraries to handle CSS.&lt;/p&gt;

&lt;p&gt;We need to create then the file &lt;strong&gt;main.erb&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid bg-green-300 border-green-600 border-b 
           p-4 m-4 rounded place-items-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-6xl text-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Email Threading&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Create the form--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;method = &lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex bg-blue-300 border-blue-600 border-b p-4 m-4 rounded place-items-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;size=&lt;/span&gt;&lt;span class="s"&gt;"50"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;/span&gt;&lt;span class="ni"&gt;&amp;amp;nbsp;&amp;amp;nbsp;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"block bg-blue-500 hover:bg-blue-700 
  text-white text-lg mx-auto py-2 px-4 rounded-full"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Search&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Do we have any threads? --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;if&lt;/span&gt; &lt;span class="na"&gt;threads&lt;/span&gt; &lt;span class="err"&gt;!=&lt;/span&gt; &lt;span class="err"&gt;[]&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"accordion-collapse"&lt;/span&gt; &lt;span class="na"&gt;data-accordion=&lt;/span&gt;&lt;span class="s"&gt;"collapse"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Counter to generate accordion elements --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;counter = &lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Loop through each thread --&amp;gt;&lt;/span&gt;  
  &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;threads.each&lt;/span&gt; &lt;span class="na"&gt;do&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;&lt;span class="na"&gt;thread&lt;/span&gt;&lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Define values for the accordion elements --&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;heading = &lt;/span&gt;&lt;span class="s"&gt;"accordion-collapse-heading-"&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="na"&gt;counter.to_s&lt;/span&gt;  &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;body = &lt;/span&gt;&lt;span class="s"&gt;"accordion-collapse-body-"&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="na"&gt;counter.to_s&lt;/span&gt;  &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;_body = &lt;/span&gt;&lt;span class="s"&gt;"#accordion-collapse-body-"&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="na"&gt;counter.to_s&lt;/span&gt;  &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="na"&gt;heading&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &amp;gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex items-center justify-between w-full p-5 font-medium 
                                 text-left text-gray-500 border border-b-0 border-gray-200 
                                 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 
                                 dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 
                                 dark:hover:bg-gray-800"&lt;/span&gt; &lt;span class="na"&gt;data-accordion-target=&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="na"&gt;_body&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
                                 aria-expanded="false" aria-controls=&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&amp;gt;
&lt;span class="c"&gt;&amp;lt;!-- Title of the thread --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;thread&lt;/span&gt;&lt;span class="err"&gt;[0]&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;data-accordion-icon&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-6 h-6 shrink-0"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"currentColor"&lt;/span&gt; 
        &lt;span class="na"&gt;viewBox=&lt;/span&gt;&lt;span class="s"&gt;"0 0 20 20"&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;path&lt;/span&gt; &lt;span class="na"&gt;fill-rule=&lt;/span&gt;&lt;span class="s"&gt;"evenodd"&lt;/span&gt;    
        &lt;span class="na"&gt;d=&lt;/span&gt;&lt;span class="s"&gt;"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 
        4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"&lt;/span&gt; &lt;span class="na"&gt;clip-rule=&lt;/span&gt;&lt;span class="s"&gt;"evenodd"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/path&amp;gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;     
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; class="hidden" aria-labelledby=&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;heading&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&amp;gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"p-5 font-light border border-b-0 border-gray-200 dark:border-gray-700"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Get size of thread array --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;count = &lt;/span&gt;&lt;span class="s"&gt;thread[1].length()&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Define amount of elements on the grid --&amp;gt;&lt;/span&gt;    
  &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;count_str = &lt;/span&gt;&lt;span class="s"&gt;"grid-rows-"&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="na"&gt;count.to_s&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid &amp;lt;%= count_str %&amp;gt; grid-flow-col gap-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Counter to access array elements --&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;counter = &lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- Loop through each email --&amp;gt;&lt;/span&gt;        
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;thread&lt;/span&gt;&lt;span class="err"&gt;[1].&lt;/span&gt;&lt;span class="na"&gt;each&lt;/span&gt; &lt;span class="na"&gt;do&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-span-2 ..."&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!-- Display image and date/time of email --&amp;gt;&lt;/span&gt;             
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mx-auto"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;%= thread[2][counter] %&amp;gt;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;thread&lt;/span&gt;&lt;span class="err"&gt;[3][&lt;/span&gt;&lt;span class="na"&gt;counter&lt;/span&gt;&lt;span class="err"&gt;]&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!-- Display the email message --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%=&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;counter = &lt;/span&gt;&lt;span class="s"&gt;counter&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;end&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; 
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;    
  &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;end&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="na"&gt;end&lt;/span&gt; &lt;span class="err"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you wonder about the public folder, it will only hold the contact profile picture, so there’s nothing we need to do there.&lt;/p&gt;

&lt;p&gt;And that’s it. We’re ready to roll.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running our Email Threading application
&lt;/h2&gt;

&lt;p&gt;In order to run our application, we just need to type the following on the terminal window:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ruby EmailThreading.rb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4pevhs6117kyqe0sir5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4pevhs6117kyqe0sir5x.png" alt="Running the application" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our application will be running on port &lt;strong&gt;4567&lt;/strong&gt; of localhost, so we just need to open our favourite browser and go to the following address:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://localhost:4567&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to learn more about our Email APIs, please go to our documentation &lt;a href="https://developer.nylas.com/docs/connectivity/email/" rel="noopener noreferrer"&gt;Email API Overview&lt;/a&gt; as well &lt;a href="https://developer.nylas.com/docs/api/#tag--Threads" rel="noopener noreferrer"&gt;Threads&lt;/a&gt; and &lt;a href="https://developer.nylas.com/docs/api/#tag--Messages" rel="noopener noreferrer"&gt;Messages&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>scss</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Python, Sentiment Analysis, R and Shiny</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Tue, 21 Jun 2022 03:12:42 +0000</pubDate>
      <link>https://dev.to/nylas/python-sentiment-analysis-r-and-shiny-ao7</link>
      <guid>https://dev.to/nylas/python-sentiment-analysis-r-and-shiny-ao7</guid>
      <description>&lt;p&gt;Knowing how your customers feel about your product is as important as creating a good product. Wouldn’t it be great if we could determine in a simple way how our customers feel by analyzing the feedback they provide via email messages?  With Nylas Neural API’s Sentiment Analysis, we can do that. Sentiment Analysis is a way of computationally analyzing a writer’s work to determine how they feel about a selected topic. With basic sentiment analysis, you can check if the writer feels positive, negative, or neutral about something.&lt;/p&gt;

&lt;p&gt;For this post, we’re going to create a simple feedback web page using Python. The sentiment information we gather will be analyzed and stored locally in a SQLite Database to be later picked up and displayed in a Shiny Dashboard using the R Programming Language. (Shiny is an R package that lets you easily display data with a variety of charts and graphs in your own dashboard.) We’re keeping everything local just for the sake of simplicity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is your system ready?
&lt;/h2&gt;

&lt;p&gt;If you don’t have the Nylas Python SDK installed and your environment isn’t configured, I would recommend you to read the post &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-python-sdk/" rel="noopener noreferrer"&gt;How to Send Emails with the Nylas Python SDK&lt;/a&gt; where everything is clearly explained.&lt;/p&gt;

&lt;p&gt;To complete this project you will need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Nylas developer account and credentials&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nylas Python SDK installed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gmail account (we will use Gmail to label and sort emails)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We will install R and Shiny later in this post, so you don’t need to worry about it now&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are we going to do?
&lt;/h2&gt;

&lt;p&gt;Let’s pretend that we are the owners of a small company that produces vegan eggs called “VeggiEggs”. We want to build a Flask application that will collect feedback from our customers and send it to us via email, so that we can store the information and also reply back as a follow up. Then we want a Python script that will read and analyze every email using Sentiment Analysis and finally create an R Shiny Script that will display a dashboard with the information we gathered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working on the application
&lt;/h2&gt;

&lt;p&gt;What we need to do first is set up a Label so that the emails are easy to find.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Label
&lt;/h3&gt;

&lt;p&gt;On Gmail, we can do the following:&lt;/p&gt;

&lt;p&gt;On the search bar, press the “Show Search Options” button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnrxtcljie7gajcrn3wxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnrxtcljie7gajcrn3wxg.png" alt=" " width="800" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, use the “veggieggs” and “feedback” words.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmuitb0aq5warmxgk3lkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmuitb0aq5warmxgk3lkq.png" alt=" " width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we create the filter, we can assign the messages to an existing label or create a new one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3em28m17uznexpj5mjtz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3em28m17uznexpj5mjtz.png" alt=" " width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We don’t need to nest it, so just enter the label name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39639nw9si23tmwpz50p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39639nw9si23tmwpz50p.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we create it, we can apply some extra filters&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcr6fnfb8gn48pua70zrr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcr6fnfb8gn48pua70zrr.png" alt=" " width="800" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, every email that we receive containing those words “VeggieEggs” and “Feedback” will go into our label and skip the inbox.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing the Flask package
&lt;/h3&gt;

&lt;p&gt;As we want to create a Python web application, our best option is to use &lt;a href="https://flask.palletsprojects.com/en/2.0.x/" rel="noopener noreferrer"&gt;Flask&lt;/a&gt;, one of the most popular Micro Frameworks in the Python world.&lt;/p&gt;

&lt;p&gt;To install it, we can type the following command on the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ pip3 install flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, we’re ready to go.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the Flask application
&lt;/h3&gt;

&lt;p&gt;As we’re going to develop this application locally and not deploy it anywhere else. We’re going to create a file called &lt;strong&gt;config.json&lt;/strong&gt; which will hold our Nylas Tokens information. This comes with Flask, so why not use it?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "NYLAS_OAUTH_CLIENT_ID": "&amp;lt;YOUR_CLIENT_ID&amp;gt;",
  "NYLAS_OAUTH_CLIENT_SECRET": "&amp;lt;YOUR_CLIENT_SECRET&amp;gt;",
  "SECRET_KEY": "&amp;lt;YOUR_SECRET_KEY&amp;gt;"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we’re going to create a file called &lt;strong&gt;FeedbackForm.py&lt;/strong&gt; which will handle getting the feedback and sending the email.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Import your dependencies
from flask import Flask,render_template,json,request,flash,redirect,url_for
from nylas import APIClient

# Create the app and read the configuration file
app = Flask(__name__)
app.config.from_file("config.json", json.load)

# Initialize your Nylas API client
def load_nylas():
    nylas = APIClient(
        app.config["NYLAS_OAUTH_CLIENT_ID"],
    app.config["NYLAS_OAUTH_CLIENT_SECRET"],
    app.config["SECRET_KEY"]
    )
    return nylas

# This the landing page
@app.route("/", methods=['GET','POST'])
def index():
# If we are reading the page, show the feedback form
    if request.method == 'GET':
        return render_template('FeedbackForm.html')
# If we are submitting feedback, read the form
    else:
        name = request.form['name']
        email = request.form['email']
        rating = request.form['rating']
        comments = request.form['comments']

# Check for required fields
        if not name:
            flash('Name is required!')
            return redirect(url_for('index'))
        elif not email:
            flash('Email is required!')
            return redirect(url_for('index'))
        elif not comments:
            flash('Comments are required!')
            return redirect(url_for('index'))           
        else:
# If everything is Ok, send the email with the feedback information
            nylas = load_nylas()
            draft = nylas.drafts.create()
            draft.subject = "VeggiEggs Feedback - {} - {} - {}".format(name, email, rating)
            draft.body = comments
    draft.to = [{"name": "&amp;lt;YOUR_NAME&amp;gt;", "email": "&amp;lt;YOUR_EMAIL&amp;gt;"}]

    draft.send()            
    return render_template('ConfirmationForm.html', 
                   name = name, email = email, 
                   rating = rating, comments=comments),            
                                                  {"Refresh":"5;url=/"}

# Run our application       
if __name__ == "__main__":
    app.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this to work properly, we need to create a file called &lt;strong&gt;FeedbackForm.html&lt;/strong&gt; and we’re going to use &lt;a href="https://tailwindcss.com" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt; to provide a quick look and feel.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;script src="https://cdn.tailwindcss.com"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;title&amp;gt;Nylas&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="bg-green-300 border-green-600 border-b p-4 m-4 rounded"&amp;gt;
    {% block content %}
    {% with messages = get_flashed_messages() %}
        {% if messages %}
            {% for message in messages %}
                {{ message }}
            {% endfor %}
        {% endif %}
    {% endwith %}
    &amp;lt;h1 class="font-black"&amp;gt;We hope you enjoyed VeggiEggs. Please take some time to leave a review&amp;lt;/h1&amp;gt;
    &amp;lt;br&amp;gt;
    &amp;lt;form method="post"&amp;gt;
        &amp;lt;label for="name" class="font-bold"&amp;gt;* Name&amp;lt;/label&amp;gt;
        &amp;lt;input type="text" name="name"
               placeholder="Your name"
               value="{{ request.form['name'] }}"&amp;gt;&amp;lt;/input&amp;gt;
        &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;label for="email" class="font-bold"&amp;gt;* Email&amp;lt;/label&amp;gt;
        &amp;lt;input type="email" name="email"
               placeholder="Your email"&amp;gt;&amp;lt;/input&amp;gt;
        &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;label for="rating" class="font-bold"&amp;gt;Choose a rating:&amp;lt;/label&amp;gt;
        &amp;lt;select name="rating"&amp;gt;
            &amp;lt;option value="1"&amp;gt;Poor&amp;lt;/option&amp;gt;
            &amp;lt;option value="2"&amp;gt;Fair&amp;lt;/option&amp;gt;
            &amp;lt;option value="3"&amp;gt;Ok&amp;lt;/option&amp;gt;
            &amp;lt;option value="4"&amp;gt;Good&amp;lt;/option&amp;gt;
            &amp;lt;option value="5" selected&amp;gt;Great&amp;lt;/option&amp;gt;
        &amp;lt;/select&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;p class="font-bold"&amp;gt;* Comments&amp;lt;/p&amp;gt;
        &amp;lt;textarea name="comments"
               placeholder="Your comments"
               rows=5
               cols=50&amp;gt;&amp;lt;/textarea&amp;gt;        
        &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full"&amp;gt;Submit&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
    &amp;lt;p class="font-bold"&amp;gt;* Required&amp;lt;/p&amp;gt;
    {% endblock %}
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we’re going to need a confirmation page as well, so that people know that their responses were recorded correctly.&lt;/p&gt;

&lt;p&gt;We're going to create a page called &lt;strong&gt;ConfirmationForm.html&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;script src="https://cdn.tailwindcss.com"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;title&amp;gt;Nylas&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="bg-green-300 border-green-600 border-b p-4 m-4 rounded"&amp;gt;
    {% block content %}
    &amp;lt;h2 class="font-semibold"&amp;gt;Thanks {{name}} - {{email}}&amp;lt;/h2&amp;gt;
    &amp;lt;h2 class="font-semibold"&amp;gt;Your rating was: {{rating}}&amp;lt;/h2&amp;gt;
    &amp;lt;h2 class="font-semibold"&amp;gt;Your comments were:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; {{comments}}&amp;lt;/h2&amp;gt;
    &amp;lt;p class="font-semibold"&amp;gt;You will be automatically redirected. 
    If it doesn't work, follow the &amp;lt;a href="{{url_for('index')}}"&amp;gt;link&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
    {% endblock %}
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can execute this script from the terminal by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python3 FeedbackForm.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fddueikzp6kuhlamw4wgz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fddueikzp6kuhlamw4wgz.png" alt=" " width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to open localhost:5000 on our favourite browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE:&lt;/em&gt;&lt;/strong&gt; If you are using Flask on a Mac that has Monterey or higher, you may have trouble accessing localhost. You can solve this by disabling the Airplay Receiver in your Sharing folder. (Airplay Receiver uses port 5000.) Follow these instructions: &lt;a href="https://www.businessinsider.com/how-to-turn-off-airplay" rel="noopener noreferrer"&gt;How to disable Airplay Receiver&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0utrnc4p1jac8h4man9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0utrnc4p1jac8h4man9.png" alt=" " width="800" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we hit submit, we will get instant feedback.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzophyat9ddgqt3xw9uh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzophyat9ddgqt3xw9uh.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We use redirection, so it will go back to the main page after 5 seconds. And here we’re displaying the information entered by the user.&lt;/p&gt;

&lt;p&gt;If we check our mailbox, we will find this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fqn783vwytkjjzw2czb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fqn783vwytkjjzw2czb.png" alt=" " width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have all the information we need on this email. So we’re ready for the next stage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Python script
&lt;/h3&gt;

&lt;p&gt;In this step, we’re going to read all the emails with the label “VeggiEggs”, in order to analyze them with the Sentiment Analysis endpoint as well as to gather important information like the rating and the date the email was sent.&lt;/p&gt;

&lt;p&gt;We’re going to create a file called &lt;strong&gt;NeuralFeeback.py&lt;/strong&gt;. It looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Load your env variables
from dotenv import load_dotenv
load_dotenv()

# Import your dependencies
import os
from nylas import APIClient
import subprocess

# Initialize your Nylas API client
nylas = APIClient(
    os.environ.get("CLIENT_ID"),
    os.environ.get("CLIENT_SECRET"),
    os.environ.get("ACCESS_TOKEN"),
)

# Gather all messages from the label “VeggiEggs”
messages = nylas.messages.where(in_="VeggiEggs")
# Create variables to hold the information to be passed to R
rating = []
sentiment = []
score = []
date = []
sRating = ""
sSentiment = ""
sScore = ""
sDate = ""

# Read all messages
for message in messages:
# Split the title in order to get the rating value
    line = message.subject.split(" - ")
    rating.append(line[3])
# Send each message to the Sentiment Analysis endpoint
    message_analysis = nylas.neural.sentiment_analysis_message([message.id])
# Extract the Sentiment Analysis result
    sentiment.append(message_analysis[0].sentiment)
    score.append(str(message_analysis[0].sentiment_score))
    date.append(str(message.received_at.date()))    

# Turn the information into a long string separated by commas
sRating = ','.join(rating)
sSentiment = ','.join(sentiment)
sScore = ','.join(score)
sDate = ','.join(date)

# We want to know when R is getting called
print("Calling R")
# Call R as a subprocess and launch Shiny in the browser
subprocess.run(["RScript", "-e", "shiny::runApp('&amp;lt;path_to_your_python_env&amp;gt;', launch.browser = TRUE)", sRating, sSentiment, sScore, sDate])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting up R
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Installing R
&lt;/h4&gt;

&lt;p&gt;As we’re going to use Shiny to create our dashboard, we need to create a R script. If you don’t have R installed on your computer you can do it like this.&lt;/p&gt;

&lt;p&gt;Here’s the latest version of R for the Mac &lt;a href="https://cran.r-project.org/bin/macosx/base/R-4.1.3.pkg" rel="noopener noreferrer"&gt;R-4.1.3&lt;/a&gt;. Also, while optional, we need to install &lt;a href="http://xquartz.macosforge.org/" rel="noopener noreferrer"&gt;XQuartz&lt;/a&gt; as it is not bundled with Mac by default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn767g9zu1afpjdwo7wwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn767g9zu1afpjdwo7wwy.png" alt=" " width="800" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing RStudio
&lt;/h4&gt;

&lt;p&gt;While it’s not mandatory, we should install &lt;a href="//rstudio.com/products/rstudio/download/#download"&gt;RStudio&lt;/a&gt; which is by far the best R IDE.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing the necessary packages
&lt;/h4&gt;

&lt;p&gt;We will need to install some packages in order to have our Shiny application running. Open up RStudio and click on “Tools → Install packages”. Type the following packages separated by a comma:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;shiny →&lt;/strong&gt; Makes it incredibly easy to build interactive web applications with R&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tidyverse →&lt;/strong&gt; The tidyverse is an opinionated &lt;a href="https://www.tidyverse.org/packages" rel="noopener noreferrer"&gt;collection of R packages&lt;/a&gt; designed for data science&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;treemap →&lt;/strong&gt; Displays hierarchical data as a set of nested rectangles&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;imager →&lt;/strong&gt; Fast image processing for images in up to 4 dimensions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;plyr →&lt;/strong&gt; Tools for Splitting, Applying and Combining Data&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzc0gy9q5afiu9d8s31t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzc0gy9q5afiu9d8s31t.png" alt=" " width="758" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to make sure to leave “Install dependencies” checked and press &lt;strong&gt;Install&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once everything is installed, we can create the script.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating the Shiny script
&lt;/h4&gt;

&lt;p&gt;We need to press File → New → R Script and save the file as &lt;strong&gt;App.r&lt;/strong&gt; then type the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Load packages
library("shiny")
library("tidyverse")
library("treemap")
library("imager")
library("plyr")

# UI Section of our Shiny app
ui &amp;lt;- fluidPage(
# Dashboard headline
  tags$div(
    HTML("&amp;lt;h1 style='color:blue;text-align:center;'&amp;gt;VeggiEggs Dashboard!&amp;lt;/h1&amp;gt;")
  ),  
# Dashboard title
  title = "VeggiEggs Dashboard!",
# Define how our plots are going to be laid off
                 fluidRow(
                   column(width=5, plotOutput(outputId = "distPlot")),
                   column(width=5,offset=2, plotOutput(outputId = "distPlot2"))
                 ),
                 fluidRow(
                   column(width=5, plotOutput(outputId = "distPlot3")),
                   column(width=5,offset=2, plotOutput(outputId = "distPlot4"))
                 )) 

# Server part, here is where the plots are defined
server &amp;lt;- function(input, output) {

# We receive the information coming from Python
  args = commandArgs(trailingOnly=TRUE)
  ratings&amp;lt;-as.integer(strsplit(args[1], ",")[[1]])
  sentiments&amp;lt;-strsplit(args[2], ",")[[1]]
  scores&amp;lt;-as.integer(strsplit(args[3], ",")[[1]])    
  dates&amp;lt;-as.Date(strsplit(args[4], ",")[[1]])

# We create a Data.Frame to better handle the data
  entries = data.frame(ratings, sentiments, scores, dates=as.Date(dates))  

# First plot. Summarize the ratings
  output$distPlot &amp;lt;- renderPlot({
    Ratings &amp;lt;- count(entries, 'ratings')
    names(Ratings)&amp;lt;-c("Ratings","Count")
    Count &amp;lt;- Ratings$Count
    Ratings %&amp;gt;%
      ggplot( aes(x = Ratings, y = Count, fill = Count)) + 
        geom_bar(stat="identity")
  })

# Second plot. How many feedbacks per day
  output$distPlot2 &amp;lt;- renderPlot({
    Freq &amp;lt;- count(entries, 'dates')
    names(Freq)&amp;lt;-c("Dates","Entries")
    Freq %&amp;gt;% 
      ggplot( aes(x=Dates, y=Entries)) +
      geom_line(color="green") +
      geom_point()
  })

# Third plot. Frequency of sentiment analysis
  output$distPlot3 &amp;lt;- renderPlot({
    Sentiment &amp;lt;- count(sentiments)
    group &amp;lt;- paste(Sentiment$x,Sentiment$freq)
    sentiment&amp;lt;-Sentiment$freq
    data &amp;lt;- data.frame(group,sentiment)
    treemap(data,
            index="group",
            vSize="sentiment",
            type="index"
    )
  })

# Fourth Plot. Display an image for each score range  
  output$distPlot4 &amp;lt;- renderPlot({
    Score&amp;lt;-mean(entries$scores)
    if (Score &amp;lt; -0.5){
      image_filename&amp;lt;-"angry-emoji.png"
    }
    if (Score &amp;gt; -0.5 &amp;amp;&amp;amp; Score &amp;lt; 0.5){
      image_filename&amp;lt;-"neutral-emoji.png"
    }
    if (Score &amp;gt; 0.5){
      image_filename&amp;lt;-"happy-emoji.jpeg"
    }

    image &amp;lt;- load.image(image_filename)
    plot(image)
  })

}

shinyApp(ui = ui, server = server)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we are calling this script from Python, there’s nothing more to do here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrxv6tslu2jd8s1xrql2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrxv6tslu2jd8s1xrql2.png" alt=" " width="200" height="200"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz29sp9yxih6cjwv300n8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz29sp9yxih6cjwv300n8.png" alt=" " width="200" height="200"&gt;&lt;/a&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4qsihd6wxjm36h7k63o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4qsihd6wxjm36h7k63o.png" alt=" " width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the images we’re using, and they need to be in the same folder as our script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calling the Dashboard
&lt;/h2&gt;

&lt;p&gt;In order to call the Dashboard, the only thing we need to do is run our Python script by typing this into the terminal window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python3 NeuralFeedback.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Dashboard will be opened automatically on the default browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk17fl4zuq4xb7jo90xyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk17fl4zuq4xb7jo90xyf.png" alt=" " width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it. Hope you like this post! You can get more information on Sentiment Analysis on the Nylas &lt;a href="https://developer.nylas.com/docs/intelligence/sentiment-analysis/#analyze-a-message" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Join our &lt;a href="https://nylas.com/events/nylas-101?utm_source=blog&amp;amp;utm_medium=referral&amp;amp;utm_campaign=webinar-nylas-101" rel="noopener noreferrer"&gt;technical demo&lt;/a&gt; to see the Nylas Platform in action&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>rlang</category>
      <category>shiny</category>
      <category>api</category>
      <category>python</category>
    </item>
    <item>
      <title>What is Nylas, why did I join and why should you care?</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Wed, 18 May 2022 10:40:46 +0000</pubDate>
      <link>https://dev.to/blag/what-is-nylas-why-did-i-join-and-why-should-you-care-10c7</link>
      <guid>https://dev.to/blag/what-is-nylas-why-did-i-join-and-why-should-you-care-10c7</guid>
      <description>&lt;p&gt;This post was originally posted on LinkedIn &lt;strong&gt;&lt;a href="https://www.linkedin.com/pulse/what-nylas-why-did-i-join-should-you-care-tejada-galindo/?trackingId=J5afsCK7ThOT7ay70blVIQ%3D%3D" rel="noopener noreferrer"&gt;What is Nylas, why did I join and why should you care?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I joined Nylas around four months ago as their first Senior Developer Advocate. It might seem like a short amount of time, but in the startup world, time moves differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nylas?
&lt;/h2&gt;

&lt;p&gt;In a nutshell, Nylas is a set of APIs that allows you to easily connect with any email, calendar and contacts provider without having to go through a lengthy and complex configuration process.&lt;/p&gt;

&lt;p&gt;In other words, we do the heavy work so you can focus on your business.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygts0rsx15ng8fvt4j1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygts0rsx15ng8fvt4j1m.png" alt="Nylas Universal APIs" width="800" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to &lt;strong&gt;Email&lt;/strong&gt;, we offer “One Email API for Every Provider”. This means our Email API is universal, and you can connect to various providers without having to write specific code for each. Also, we provide real-time, bi-directional sync, and full CRUD capabilities. If you want to learn more, just go to our &lt;a href="https://www.nylas.com/products/email-api/" rel="noopener noreferrer"&gt;Universal Email API&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvovmg3i8xj4si64faf3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvovmg3i8xj4si64faf3v.png" alt="Nylas Email API" width="628" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to &lt;strong&gt;Calendar&lt;/strong&gt;, we offer the same capabilities as our Email API, but also conferencing sync, events metadata, and programmatic webhooks. If you want to learn more, just go to our &lt;a href="https://www.nylas.com/products/calendar-api/" rel="noopener noreferrer"&gt;Universal Calendar API&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe504ba4k4wgp5mu085lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe504ba4k4wgp5mu085lb.png" alt="Nylas Calendar API" width="621" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to Contacts, you can create, update or delete contacts in any supported provider. If you want to learn more, just go to our &lt;a href="https://www.nylas.com/products/contacts-api/" rel="noopener noreferrer"&gt;Universal Contacts API&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F229n4fyt3mabx24uybqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F229n4fyt3mabx24uybqs.png" alt="Nylas Contacts API" width="621" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Email, Calendar, and Contacts APIs, we’re just getting started. Check out what we offer on top of these APIs to give developers even more power.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Neural API&lt;/strong&gt;, exploring the world of AI and ML is easy, with ready-made models that can be used to clean conversations, extract signatures, perform OCR, and run sentiment analysis. If you want to learn more, just go to our &lt;a href="https://www.nylas.com/products/neural-api/" rel="noopener noreferrer"&gt;Neural API&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1hladp4nggsrtm9adid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1hladp4nggsrtm9adid.png" alt="Nylas Neural API" width="620" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nylas Streams&lt;/strong&gt; is our ETL solution that requires little to no code to transform and consume communications data for E-Commerce, Sales, Fintech and Customer Success. If you want to learn more, just go to our &lt;a href="https://www.nylas.com/products/nylas-streams" rel="noopener noreferrer"&gt;Nylas Streams&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feuythv0a5sj28dmqfpqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feuythv0a5sj28dmqfpqo.png" alt="Nylas Data Streams" width="800" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduler&lt;/strong&gt;, a full-featured scheduler with customizable UI. If you want to learn, just go to &lt;a href="https://www.nylas.com/products/nylas-scheduler" rel="noopener noreferrer"&gt;Scheduler&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F56j34kj1sf54xmbirzdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F56j34kj1sf54xmbirzdq.png" alt="Nylas Scheduler" width="621" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components&lt;/strong&gt;, ready-made and fully flexible UI/UX widgets ready for immediate use. If you want to learn more, just go to &lt;a href="https://www.nylas.com/products/components/" rel="noopener noreferrer"&gt;Components&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ou82drwr1mhzmrgem45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ou82drwr1mhzmrgem45.png" alt="Nylas Components" width="621" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did I join?
&lt;/h2&gt;

&lt;p&gt;The first thing that caught my attention with Nylas was the fact that they provide APIs to make communications easier. Handling Email, Calendars and Contacts gives a lot of space to create amazing applications.&lt;/p&gt;

&lt;p&gt;The second thing that attracted me to Nylas was the company culture. Everybody looked committed to each other, as I saw a lot of internal support when the Nylas account posted something on social media, and also my interviews were more like chatting with friends than actual interviews.&lt;/p&gt;

&lt;p&gt;The third and probably most important thing for me, was going back to Developer Advocacy, which is something that I’m really passionate about. Being able to share with the community is something that makes me feel good and that makes me a better person and a better developer.&lt;/p&gt;

&lt;p&gt;Obviously, those 3 things might not be enough to convince you, so let’s create a small example.&lt;/p&gt;

&lt;p&gt;For this, I’m going to choose one of my favourite Programming Languages–  &lt;a href="https://www.r-project.org/" rel="noopener noreferrer"&gt;R&lt;/a&gt;. And while I’m not an R professional or expert, I’m very passionate about it, so bear with me, there might be better ways to do this.&lt;/p&gt;

&lt;p&gt;What we are going to do is simply read the first three messages in my inbox and print the subjects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3l5gno1d4rl05lfsvrji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3l5gno1d4rl05lfsvrji.png" alt="R Code Sample" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result is going to be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A Nylas email

Invitation: RRSP Webinar @ Tue Feb 8, 2022 1pm - 2pm (EST) (alvaro.t@nylas.com) 

Start here: Welcome to Clockwise
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Obviously, while R is an awesome language used by statisticians and data scientists around the world, it is not a mainstream language.&lt;/p&gt;

&lt;p&gt;That’s why Nylas provides us with SDKs for &lt;a href="https://developer.nylas.com/docs/developer-tools/sdk/python-sdk/" rel="noopener noreferrer"&gt;Python&lt;/a&gt;, &lt;a href="https://developer.nylas.com/docs/developer-tools/sdk/ruby-sdk/" rel="noopener noreferrer"&gt;Ruby&lt;/a&gt;, &lt;a href="https://developer.nylas.com/docs/developer-tools/sdk/node-sdk/" rel="noopener noreferrer"&gt;Node&lt;/a&gt;, and &lt;a href="https://developer.nylas.com/docs/developer-tools/sdk/java-sdk/" rel="noopener noreferrer"&gt;Java&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s see how we can read our inbox using the &lt;a href="https://www.python.org/" rel="noopener noreferrer"&gt;Python&lt;/a&gt; SDK. If you want to learn how to install the SDK, read our &lt;a href="https://developer.nylas.com/docs/developer-tools/sdk/python-sdk/" rel="noopener noreferrer"&gt;Python Documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbihdxukpd2534hlfw6tn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbihdxukpd2534hlfw6tn.png" alt="Python Code Sample" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result is going to be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A Nylas email

Invitation: RRSP Webinar @ Tue Feb 8, 2022 1pm - 2pm (EST) (alvaro.t@nylas.com) 

Start here: Welcome to Clockwise
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, using the SDK is easier, because we don’t need to traverse the JSON response or figure out where the element that we want to print is. Also, if something changes internally we can rest assured that the SDK will be updated to reflect any changes while simply calling the API will require some manual work. And the same goes for Calendar, Contacts, and the rest of our offerings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should you care?
&lt;/h2&gt;

&lt;p&gt;Well, to begin with, I’m your friendly Developer Advocate so you know I’m going to provide you with constant and interesting content about the Nylas APIs. Also, signing up for a Nylas account is easy, no Credit Card is required and you can get 14 days to try it out. Ready to go? Just go to &lt;a href="https://dashboard.nylas.com/register" rel="noopener noreferrer"&gt;https://dashboard.nylas.com/register&lt;/a&gt; and follow the instructions.&lt;/p&gt;

&lt;p&gt;Also, I’m already working on a series of blog posts that will help you to get started, make your first API calls and in overall, get the full Nylas experience.&lt;/p&gt;

&lt;p&gt;You can start by reading my blog &lt;a href="https://www.nylas.com/blog/how-to-send-emails-with-the-nylas-python-sdk/" rel="noopener noreferrer"&gt;How to Send Emails with the Nylas Python SDK&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don’t think Nylas is for you? Well, recommend us to a friend then. You might know someone who could benefit from having fast, easy, and convenient access to universal communication APIs.&lt;/p&gt;

</description>
      <category>nylas</category>
      <category>python</category>
      <category>rlang</category>
      <category>api</category>
    </item>
    <item>
      <title>5 not well known Programming Language that are worth exploring</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Wed, 02 Feb 2022 17:08:19 +0000</pubDate>
      <link>https://dev.to/blag/5-not-well-known-programming-language-that-are-worth-exploring-33f4</link>
      <guid>https://dev.to/blag/5-not-well-known-programming-language-that-are-worth-exploring-33f4</guid>
      <description>&lt;p&gt;Just because you don't know them...doesn't mean they are not good Programming Languages...&lt;/p&gt;

&lt;p&gt;I already talked about Old Programming Languages on &lt;a href="https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe"&gt;5 old Programming Languages you should know about&lt;/a&gt; and &lt;a href="https://dev.to/blag/5-old-programming-languages-you-might-want-to-be-aware-of-345a"&gt;5 old Programming Languages you might want to be aware of&lt;/a&gt;, so this time let's talk about Programming Languages that not that well known, but that you might find really interesting to work with...&lt;/p&gt;

&lt;p&gt;To illustrate how those programming work, we're to use a very basic app called "Fibonacci List" which will simply output a list of requested Fibonacci numbers, for example if we ask for 5, it should return 0, 1, 1, 2, 3, 5.&lt;/p&gt;

&lt;p&gt;Let's start our list with &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mercury (1995)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnk5vi83b6d6b8qa185z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnk5vi83b6d6b8qa185z.png" alt="Mercury Logo" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mercury is a Logical/Functional Programming Language. It looks like Prolog, but feels like strict Haskell or pure OCalm.&lt;/p&gt;

&lt;p&gt;On Linux, you can download the source from &lt;a href="http://dl.mercurylang.org/index.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; and simply do&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./CONFIGURE --&amp;gt; MAKE --&amp;gt; MAKE INSTALL&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:- module fibonacci.
:- interface.
:- import_module io.

:- pred main(io::di, io::uo) is det.

:- implementation.
:- import_module string, int.
:- pred fibo(int::in, int::in, int::in, string::out) is det.

fibo(Num, A, B, Fibs) :-
    (   
        if A = 0 
        then fibo(Num-1,A+B,B,Fib), 
             Fibs = int_to_string(A) ++ " " ++ 
             int_to_string(B) ++ " " ++ 
             int_to_string(A+B) ++ " " ++ Fib
        else if A &amp;gt; 0, Num &amp;gt; 1
        then fibo(Num-1,A+B,A,Fib), 
             Fibs = int_to_string(A+B) ++ " " ++ Fib
        else Fibs = ""
    ).


main(!IO) :-
    io.write_string("Enter a number: ",!IO),  
    io.read_line_as_string(Result, !IO),    
    (   if    
            Result = ok(String),            
            string.to_int(string.strip(String), N)            
        then        
            fibo(N,0,1,Fibs),            
            io.write_string(Fibs,!IO)            
        else        
            io.write_string("Not a number...",!IO)            
    ).  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to run this, we need to compile it first by using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mmc --make -E name_of_file.m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fp1vds007iilyw086e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fp1vds007iilyw086e9.png" alt="Mercury Exec" width="724" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Mercury Introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Mercury_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Falcon (2001)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww684ar5cbxbvwluv92b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww684ar5cbxbvwluv92b.png" alt="Falcon Logo" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Multiparadigm Programming Languages, supporting Procedural, Object Oriented, Prototype-based, Functional, Tabular and Message passing.&lt;/p&gt;

&lt;p&gt;It should be already available on most Linux distributions, but if not you grab it from &lt;a href="http://www.falconpl.org/index.ftd?page_id=official_download" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It's syntax is fairly similar to many other programming languages, so it should be easy to pick up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function fib(num,a,b)
    result = ""
    if a &amp;gt; 0 and num &amp;gt; 1
        result = result + (a+b) + " " +  
                 fib(num-1,a+b,a)       
    elif a == 0 
        result = "" + a + " " + b + " " +       
                 (a+b) + " " + fib(num-1,a+b,b)     
    end 
    return result   
end

print("Enter a number: ")
num = int( input() )
print(fib(num,0,1))
printl("")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to run simply type&lt;/p&gt;

&lt;p&gt;&lt;code&gt;falcon name_of_file.fal&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92flv7fl08kugmy7x2o1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92flv7fl08kugmy7x2o1.png" alt="Falcon Exec" width="725" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Falcon introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Falcon_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dao (2004)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwt1xt27od6l2m1mas8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwt1xt27od6l2m1mas8r.png" alt="Dao Logo" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lightweight and optionally typed Programming Language. The author created out of frustration with Perl.&lt;/p&gt;

&lt;p&gt;You can download the &lt;a href="https://github.com/daokoder/dao" rel="noopener noreferrer"&gt;source code&lt;/a&gt; and extract it. &lt;/p&gt;

&lt;p&gt;Then type &lt;/p&gt;

&lt;p&gt;&lt;code&gt;make -f Makefile.daomake PLATFORM&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where PLATFORM can be linux, macos, mingw and more...&lt;/p&gt;

&lt;p&gt;Finally, run&lt;/p&gt;

&lt;p&gt;&lt;code&gt;make install&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;routine fib(num :int, a :int, b :int){
  var result = ""
  if (a &amp;gt; 0 and num &amp;gt; 1){
    result = result + " " + (string)(a + b) + 
             fib(num - 1, a + b, a)
  }else if (a == 0) {
    result = (string)a + " " + (string)b + " " + 
             (string)(a + b) + fib(num - 1, a + b, b)
  }
  return result
}

io.write('Enter a number: ')
invar num = io.read()
io.writeln(fib((int)num, 0, 1))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run this, simply type&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dao name_of_file.dao&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk9gbj01b8wcevw5e5s4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk9gbj01b8wcevw5e5s4.png" alt="Dao Exec" width="736" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Dao Introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Dao_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Factor (2003)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjnkwqnr7tdj4qlla47fh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjnkwqnr7tdj4qlla47fh.png" alt="Factor Logo" width="777" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Stack-Oriented Programming Language, based on Forth and Lisp.&lt;/p&gt;

&lt;p&gt;If you like Forth, you will love Factor.&lt;/p&gt;

&lt;p&gt;To install, simply go to the &lt;a href="http://factorcode.org/" rel="noopener noreferrer"&gt;Factor Homepage&lt;/a&gt; and download the binary. Then run it.&lt;/p&gt;

&lt;p&gt;You will get a listener and that's where you application will be executed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe4mz168iqwegnd1x4ays.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe4mz168iqwegnd1x4ays.png" alt="Factor Listener" width="559" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Type the following on the Listener.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE: tools.scaffold

"fibo" scaffold-work  ! You might get an error saying 
                      ! that "fibo" doesn't exist...
                      ! ignore that -:)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a "fibo" folder inside the "work" folder inside your Factor installation folder.&lt;/p&gt;

&lt;p&gt;Then edit the "fibo.factor" file that was generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;! Copyright (C) 2018 Blag.
! See http://factorcode.org/license.txt for BSD license.
USING: math prettyprint kernel io math.parser command-line 
       namespaces sequences ;
IN: fibo

&amp;lt;PRIVATE
: ask-number ( -- ) "Enter a number: " print ;
: read-number ( -- n ) readln string&amp;gt;number ;
: list_fibo ( x -- )
 1 0
 pick 1 + [ dup . over over + rot drop ] times 3drop ;
PRIVATE&amp;gt;

: fibo ( -- ) ask-number read-number list_fibo ;
: fibo-run ( -- ) fibo ;
MAIN: fibo-run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the Listener type &lt;/p&gt;

&lt;p&gt;&lt;code&gt;fibo run&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00dzuguufuerpz84dchn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00dzuguufuerpz84dchn.png" alt="Factor Run" width="397" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Factor Introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Factor_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;io (2002)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jgfpnvwlhyxdub34yfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jgfpnvwlhyxdub34yfc.png" alt="IO Logo" width="405" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pure, dynamic, concurrent and accessible Programming Language. Inspired by Smalltalk, Self, NewtonScript, Act, Lisp and Lua.&lt;/p&gt;

&lt;p&gt;To install it just follow the instructions on &lt;a href="https://github.com/IoLanguage/io" rel="noopener noreferrer"&gt;IO's Github&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#This method needs to go in one line...

fib := method(num,a,b,result, 
       if(a &amp;gt; 0 and num &amp;gt; 1) 
       then(result = result .. (a+b) .. " " .. 
            fib(num-1,a+b,a,result)) 
       elseif(a == 0) 
       then(result = a .. " " .. b .. " " .. 
            (a+b) .. " " .. fib(num-1,a+b,b,result)); 
            return result)


"Enter a number: " print
number := ReadLine readLine
fib(number asNumber,0,1,"") println
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run this simply do&lt;/p&gt;

&lt;p&gt;&lt;code&gt;io name_of_file.io&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9t6kvsyos4x4eynwkf7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9t6kvsyos4x4eynwkf7x.png" alt="IO Exec" width="736" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my IO Introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/io_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope you try some...and see you next time -:)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>motivation</category>
    </item>
    <item>
      <title>5 old Programming Languages you might want to be aware of</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Tue, 25 Jan 2022 19:19:19 +0000</pubDate>
      <link>https://dev.to/blag/5-old-programming-languages-you-might-want-to-be-aware-of-345a</link>
      <guid>https://dev.to/blag/5-old-programming-languages-you-might-want-to-be-aware-of-345a</guid>
      <description>&lt;p&gt;Learning from the past can help you look into the future.&lt;/p&gt;

&lt;p&gt;As my post &lt;a href="https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe"&gt;5 old Programming Languages you should know about&lt;/a&gt; was successful so I decided to keep going...&lt;/p&gt;

&lt;p&gt;This time I want to share some old programming languages that might not be so "well known" but that are still important pieces of the history of programming...&lt;/p&gt;

&lt;p&gt;To illustrate how those programming languages work, we're to use a very basic app called "Fibonacci List" which will simply output a list of requested Fibonacci numbers, for example if we ask for 5, it should return 0, 1, 1, 2, 3, 5. &lt;br&gt;
We used before, so why not used it here again...&lt;/p&gt;

&lt;p&gt;We're not going in order this time...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Miranda (1985)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu3a0zmxkpctntf2dfry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu3a0zmxkpctntf2dfry.png" alt="Miranda Logo" width="303" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lazy, purely functional programming language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fib :: (num, num, num) -&amp;gt;  [char]
fib(num,a,b) = show(a+b) ++ " " ++ 
               fib((num - 1),(a+b),a), if(a &amp;gt; 0 &amp;amp; num &amp;gt; 1)
             = show(a) ++ " " ++ show(b) ++         
               " " ++ show(a+b) ++ " " ++                
               fib((num - 1),(a+b),b), if(a == 0)
             = [], otherwise

showFib :: num -&amp;gt; [char]
showFib num = "\n" ++  fib(num, 0, 1) ++ "\n"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see...Miranda doesn't have variables, arrays, tables or dictionaries...so lists are your best friends...doesn't have loops so recursion is a must...&lt;br&gt;
It was a major inspiration for Haskell.&lt;/p&gt;

&lt;p&gt;Compilers are available &lt;a href="http://miranda.org.uk/downloads" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
To run it we do...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mira name_of_file.m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then call the main function with its corresponding parameter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;showFib 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5v5184npiafyeqwfz22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5v5184npiafyeqwfz22.png" alt="Miranda Exec" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Miranda introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Miranda_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rexx (Restructured Extended Executor - 1979)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78qf2v3xkhpoh27tpwpp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78qf2v3xkhpoh27tpwpp.png" alt="Rexx Logo" width="245" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Multiparadigm, procedural, structured and interpreted programming language, but also scripting and macro.&lt;br&gt;
It is considered the very first Scripting Language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;say "Enter a number: "
pull number .
say ""
call fibo number, 0, 1
say
exit 0

if a = 0 then
    do
        a_b = a + b
        call charout, (a b a_b)
        call charout, " "
        call fibo num - 1, a + b, b
    end
else if a &amp;gt; 0 &amp;amp; num &amp;gt; 1 then
   do
        a_b = a + b
        call charout, a_b
        call charout, " "
        call fibo num - 1, a + b, a
    end
return
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are no arrays in Rexx...we call them compounds. We have functions and subroutines, as well as some sort of stack. It's actually pretty fun to use...&lt;/p&gt;

&lt;p&gt;On Linux, we can get the compiler as easy as doing this...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install -y regina-rexx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For other platforms, go &lt;a href="https://sourceforge.net/projects/regina-rexx/files/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To run we simply do this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;regina name_of_file.rexx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9q92zhwtikku995j67i5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9q92zhwtikku995j67i5.png" alt="Rexx exec" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Rexx introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Rexx_Introduction.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Icon (1977)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17q98ts6z77p9e4o2tyz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17q98ts6z77p9e4o2tyz.png" alt="Icon Logo" width="262" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Very high-level programming language featuring goal-directed execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;procedure fib(num, a, b)
    local result
    result := ""    
    if a &amp;gt; 0 &amp;amp; num &amp;gt; 1 then    
        result := result || " " || (a + b) ||         
                  fib(num - 1, a + b, a)        
    else if a = 0 then    
        result := a || " " || b || " " ||         
                  (a + b) || fib(num - 1, a + b, b)        
    return result    
end

procedure main()
    local num 
    write("Enter a number: ") 
    num := read() 
    write(" ") 
    write(fib(num, 0, 1))
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's not data type declaration...as it changes according to its value. An operations can success or fail...which prevents crashes.  Icon doesn't have arrays, but lists, records and tables and list can be composed of different data types.&lt;/p&gt;

&lt;p&gt;You can download Icon from &lt;a href="https://www2.cs.arizona.edu/icon/current/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And follow &lt;a href="https://www2.cs.arizona.edu/icon/current/install.htm" rel="noopener noreferrer"&gt;these&lt;/a&gt; instructions to compile it. &lt;/p&gt;

&lt;p&gt;To run our app we simply need to call it like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;icon name_of_file.icn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufjyn7r6sfehb2madgkd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufjyn7r6sfehb2madgkd.png" alt="Icon Exec" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Icon introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Icon_Introduction.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prolog (Programming Logic - 1972)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbcrvu09e9kb53sya5hv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbcrvu09e9kb53sya5hv.png" alt="Prolog Logo" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;General purpose logic programming language associated with artificial intelligence and computational linguistics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fibo(NUM,A,B,[H|T]) :- (NUM &amp;gt; 1 -&amp;gt; H is A + B, X is NUM - 1, 
                        (A =:= 0 -&amp;gt; fibo(X,H,B,T); fibo(X,H,A,T))).
fibo(_,_,_,[]).

fibonacci(NUM,R) :- fibo(NUM,0,1,X), !, append([0,1], X, R).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prolog is declarative and the program logic is expressed in terms of relations, represented as facts and rules. Recursion is a key component of Prolog.&lt;/p&gt;

&lt;p&gt;For this I'm using &lt;a href="http://www.swi-prolog.org/download/stable" rel="noopener noreferrer"&gt;swi-prolog&lt;/a&gt; because it's free and widely used.&lt;/p&gt;

&lt;p&gt;To run this example, simply do this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swipl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the call our filename like this...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[fibonacci].
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, call the main function like this...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fibonacci(5,X).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3qfvfwmr3n2ybo5o2l4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3qfvfwmr3n2ybo5o2l4.png" alt="Prolog Exec" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Prolog introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Prolog_Introduction.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And least but not last...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forth (1970)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imperative stack-based programming language and programming environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzwbpt2ki8zij3ffz96tc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzwbpt2ki8zij3ffz96tc.png" alt="Forth Logo" width="299" height="115"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;: FIBO 
   1 SWAP 
   0 DUP . 
   ?DO 
      DUP . OVER OVER + ROT DROP 
   LOOP 
   DROP DEPTH 
   DEPTH 2 = IF 2DROP 0 THEN ; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we manipulate the stack, we use LIFO (Last In, First Out). There's a lot of functions to help us with the stack, like duplicate, rotate, swap and so on...&lt;/p&gt;

&lt;p&gt;If you're using Linux, simply do this...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install pforth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're using Windows then go &lt;a href="https://code.google.com/p/pforth/downloads/list" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In order to run this example simply call&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pforth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And once inside the environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INCLUDE name_of_file.fth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0rc2ixgq9uqowzx6pdh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0rc2ixgq9uqowzx6pdh.png" alt="Forth Exec" width="647" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Forth introduction &lt;a href="https://blagarts.com/static/GeekyThursday/Languages/Forth_Introduction.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it...I hope you like this post and next one coming should be &lt;strong&gt;5 not well known Programming Language that are worth exploring&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blag.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>motivation</category>
      <category>old</category>
    </item>
    <item>
      <title>5 old Programming Languages you should know about</title>
      <dc:creator>Alvaro (Blag) Tejada Galindo</dc:creator>
      <pubDate>Fri, 21 Jan 2022 14:32:11 +0000</pubDate>
      <link>https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe</link>
      <guid>https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe</guid>
      <description>&lt;p&gt;This post was originally posted on &lt;a href="https://www.linkedin.com/pulse/5-old-programming-languages-you-should-know-alvaro-tejada-galindo/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;For some people, old programming languages are ugly, obsolete, old-fashioned and useless. For me, they're the complete opposite...gems waiting to be rediscovered.&lt;/p&gt;

&lt;p&gt;An old programming language can teach you a lot and can make you for sure a better developer. People today are getting used to have everything provided by the language and that's bad because it doesn't force you to think. Old programming language lack a lot of things that you find in modern languages, but that doesn't mean they're not as powerful, as they provide you all the tools to implement things yourself.&lt;/p&gt;

&lt;p&gt;To illustrate how those programming work, we're to use a very basic app called "Fibonacci List" which will simply output a list of requested Fibonacci numbers, for example if we ask for 5, it should return 0, 1, 1, 2, 3, 5.&lt;/p&gt;

&lt;p&gt;Let's start with the oldest programming language I know...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FORTRAN (Formula Translator - 1957)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl68kd4mctjacriehybqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl68kd4mctjacriehybqf.png" alt="FORTRAN LOGO" width="259" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A general-purpose, imperative programming language that is essentially suited to numeric computations and scientific computing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;program fibonacci

  implicit none
  integer :: a=0, b=1, num
  write(*,'(a)',advance="no") "Enter a number: "
  read(*,*) num
  write(*,*) trim(fib(num, a, b))

contains

recursive function fib(num, a, b) result(fibo)

  integer, intent(in) :: num, a, b
  integer :: ab
  character(1000) :: a_s, b_s, ab_s
  character(1000) :: fibo

  if(a &amp;gt; 0 .and. num &amp;gt; 1) then
    ab = a + b
    write(ab_s, '(I0)') ab
    fibo = trim(ab_s) // " " // fib(num - 1, ab, a)
  else if (a == 0) then
    ab = a + b
    write(a_s, '(I0)') a
    write(b_s, '(I0)') b
    write(ab_s, '(I0)') ab
    fibo = trim(a_s) // " " // trim(b_s) // " " // 
           trim(ab_s) // " " // trim(fib(num - 1, ab, b))
  else
    fibo = ""
  end if

  return
end function fib

end program fibonacci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see...A program must be enclosed between "program" and "end program" tag. Variables need a type when they are declared. A recursive function must be labeled as "recursive". String variables are fixed in length. "//" is used to concatenate. Integers and Character can be concatenated together without further transformations. We need to trim a lot to avoid extra space due to the really long fixed size. Functions can return zero, one or multiple values.&lt;/p&gt;

&lt;p&gt;To compile this...I used GFORTRAN which come with Linux, but can be simply installed by doing "sudo apt-get install gfortran". Being a GNU App...this is not a real Fortran compiler...it's written in C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GFORTRAN -WALL -C "NAME_OF_FILE.F95"
GFORTRAN -WALL -O "NAME_OF_EXEC" "NAME_OF_FILE.F95"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xglbx0ga42o4qkolsez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xglbx0ga42o4qkolsez.png" alt="FORTRAN EXEC" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my FORTRAN Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Fortran_Introduction/Fortran_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cobol (Common Object Business Oriented Language - 1959)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fugdj84kmj2v02lf2u2vi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fugdj84kmj2v02lf2u2vi.png" alt="Cobol Logo" width="681" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A compiled English-like computer programming language designed for business use.&lt;/p&gt;

&lt;p&gt;It's imperative, procedural and since 2002, Object Oriented.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IDENTIFICATION DIVISION.
PROGRAM-ID. fibonacci.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
    01 USER-NUMBER      PIC 9(3).
    01 A                PIC 9(3).
    01 B                PIC 9(3).
    01 AB               PIC 9(3).
    01 COUNTER          PIC 9(3).   
    01 COUNTER-SPACES   PIC 9(3).

PROCEDURE DIVISION.
PROGRAM-BEGIN.
    MOVE 0 TO A.
    MOVE 1 TO B.
    DISPLAY "Enter a number: ".
    ACCEPT USER-NUMBER.
    PERFORM GET-FIBO WITH TEST AFTER UNTIL USER-NUMBER = 1.
    DISPLAY " ".

PROGRAM-DONE.
STOP RUN.

GET-FIBO.
    IF A = 0
        COMPUTE AB = A + B
        INSPECT AB TALLYING COUNTER FOR CHARACTERS
        INSPECT AB TALLYING COUNTER-SPACES FOR LEADING ZEROS
        COMPUTE COUNTER-SPACES = COUNTER-SPACES - COUNTER
        DISPLAY 0 " " 1 " " AB(COUNTER:COUNTER-SPACES) WITH NO ADVANCING
        COMPUTE USER-NUMBER = USER-NUMBER - 1
        MOVE AB TO A
    ELSE
        MOVE 0 TO COUNTER
        MOVE 0 TO COUNTER-SPACES        
        COMPUTE AB = A + B
        INSPECT AB TALLYING COUNTER FOR CHARACTERS
        INSPECT AB TALLYING COUNTER-SPACES FOR LEADING ZEROS
        IF COUNTER-SPACES = 0
            DISPLAY " " AB WITH NO ADVANCING
        END-IF
        IF COUNTER-SPACES = 1
            COMPUTE COUNTER = COUNTER - COUNTER-SPACES
            DISPLAY " " AB(COUNTER:COUNTER) WITH NO ADVANCING
        END-IF
        IF COUNTER-SPACES = 2
            COMPUTE COUNTER-SPACES = COUNTER-SPACES - COUNTER
            DISPLAY " " AB(COUNTER:COUNTER-SPACES) WITH NO ADVANCING
        END-IF
        COMPUTE USER-NUMBER = USER-NUMBER - 1
        MOVE A TO B
        MOVE AB TO A
    END-IF.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see...Cobol is very strict...it has "divisions" and "sections". Variables need to be declared first and cannot be declared anywhere else outside it's section. Moving a value into a variable is not the same as assigning a value to a variable. There is no such thing as IF-ELSE. You can inspect a variable to get its length or amount of zeros.&lt;/p&gt;

&lt;p&gt;I know you're wondering what the heck "PIC 9" means...well..."9" is for numeric values, "X" for alphanumeric, "S" for sign and "V" for decimals.&lt;/p&gt;

&lt;p&gt;To compile this...I used Open-Cobol that can be simply installed by doing "sudo apt-get install open-cobol". Being a GNU App...this is not a real Cobol compiler...it's written in C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COBC -X -FREE -O "NAME_OF_FILE" "NAME_OF_FILE.COB"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmpxk9q26um3zkwt8rz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmpxk9q26um3zkwt8rz7.png" alt="Cobol Exec" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Cobol Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Cobol_Introduction/Cobol_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simula (Simulation Programming Language - 1962)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujx20075xsps5y8r2v4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujx20075xsps5y8r2v4o.png" alt="Simula Logo" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Superset of Algol 60. Consired the first Object Oriented programming language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;begin
    integer num;
    text result;

    procedure fib(num, a, b);
    integer num, a, b;
    begin
        if a &amp;gt; 0 and num &amp;gt; 1 then
            begin
                OutInt(a+b,3);
                fib(num - 1, a + b, a);         
            end;
        if a = 0 then
            begin
                OutInt(a,3);
                OutInt(b,3);
                OutInt(a+b,3);
                fib(num - 1, a + b, b);
            end;    
    end;

    OutText("Enter a number: ");
    OutImage;
    num := InInt;
    fib(num,0,1)
    OutImage;
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every program start with a "Begin - End". Variables need a type. We can have global and local variables. "OutInt" is used to print Integers on the screen while "OutText" is for strings. OutImage is used to print an empty line. Integer variables are assigned using "=" while String variables use ":=".&lt;/p&gt;

&lt;p&gt;To compile, I used GNU CIM which is a transpiler from Simula to C. You can install it from &lt;a href="http://simula67.at.ifi.uio.no/cim.shtml" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cim "NAME_OF_FILE.cim"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvulw50k0yi29pa8s20t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvulw50k0yi29pa8s20t.png" alt="Simula Exec" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Simula Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Simula_Introduction/Simula_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snobol (String Oriented and Symbolic Language - 1967)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fglsln10jp4rh8x4xwbb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fglsln10jp4rh8x4xwbb7.png" alt="Snobol Logo" width="320" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imperative and Unstructured programming Language. Also, it's goal oriented.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Fibonacci Sequence

        define('fibo(num,a,b)temp','fib')       :(fibo_end)
fib     fibo = eq(a,0)  a ' ' b ' ' ( a + b )   
        num = num - 1   
        a = a + b                               :s(fib0)
fib0    gt(num,1)                               :s(fib1)f(return)
fib1    fibo = gt(a,0) fibo ' ' ( a + b )       
        num = num - 1   
        temp = a                        
        a = a + b                               
        b = temp                                :s(fib0)f(return)
fibo_end

        output = 'Enter a number: '
        num = input
        output = fibo(num,0,1)
end 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables doesn't need a data type, it's type depend on the assigned value. When defining a method we need to specify what to call when it ends or fails. For each section we need to determine if it works or not and depending on that move to another section. An "If" condition needs to be by itself and move to other section depending on the result. In this example "gt(num,1)" is an "If" statement.&lt;/p&gt;

&lt;p&gt;To compile we need to first build the compiler...which is by the way a C app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WGET FTP://FTP.ULTIMATE.COM/SNOBOL/SNOBOL4-1.5.TAR.GZ
TAR –ZXVF SNOBOL4-1.5.TAR.GZ &amp;amp;&amp;amp; CD SNOBOL4-1.5
SUDO APT-GET INSTALL M4
SUDO MAKE INSTALL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run we need to do...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snobol "NAME_OF_FILE.sno"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhioqyff89xa7pjktfl6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhioqyff89xa7pjktfl6l.png" alt="Snobol Exec" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Snobol Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Snobol_Introduction/Snobol_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algol68 (Algorithmic Language - 1968)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Part of the Algol family of imperative programming Languages (Algol58, Algol60 and Algol68). One of the most influential languages of all time, giving rise to Simula, B, Pascal and C amongst many others.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BEGIN
    print("Enter a number: ");
    INT num = read int;

    PROC fib = (INT num, a, b)VOID:
        IF a &amp;gt; 0 THEN
            IF num &amp;gt; 1 THEN
                printf(($g(0)x$, a + b));
                fib(num-1, a+b, a)
            FI
        ELIF a = 0 THEN
            printf(($g(0)x$, a + b));
            fib(num-1, a+b, b)
        FI;

    printf(($g(0)x$, 0, 1));    
    fib(num,0,1);
    print(newline)
END
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All applications start with a BEGIN-END. Variables need a type. Procedures can have zero or more parameters. The last value is returned and a value must be always returned. When printing a number, the sign will be displayed, that's why we need to format its output. This one most likely the first programming language to use "ELIF", and also "FI" to close an "IF" statement. ";" is used to end a line.&lt;/p&gt;

&lt;p&gt;To compile, we need to first install Algol68Genie&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SUDO APT-GET INSTALL -Y ALGOL68G
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can simply do...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a68g "NAME_OF_FILE.a68g"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34vdmm7brc1wa6tmkley.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34vdmm7brc1wa6tmkley.png" alt="Algol Exec" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Algol68 Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Algol_Introduction/Algol_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus Section&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I know...five is not enough...so why not include a bonus language...one that always interested me as the name seems kind of weird for a programming language -;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smalltalk (1972)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylqp0d6rsz7qdmdmc7k1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylqp0d6rsz7qdmdmc7k1.png" alt="SmallTalk Logo" width="220" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An object-oriented, dynamically typed reflective programming language.&lt;/p&gt;

&lt;p&gt;Smalltalk had influenced many languages like Objective-C, Java, Python, Ruby and many more...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| number fib result |

result := ''.

fib := [:num :a :b |

    a &amp;gt; 0 &amp;amp; (num asNumber &amp;gt; 1) ifTrue: [
        result := result , (a + b) asString , ' ' , 
                  (fib value: (num asNumber - 1) value: (a + b) value: a).
    ] ifFalse: [
        a = 0 ifTrue: [
            result := a asString , ' ' , b asString , ' ' , (a + b) asString , ' ' , 
            (fib value: (num asNumber - 1) value: (a + b) value: b).
        ]. 
    ].
].

Transcript show: 'Enter a number: '.
num := stdin nextLine.

Transcript show: (fib value: num value: 0 value: 1); cr.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables are declared between "|". Values are assigned using ":=". "IF" statements are special as they are defined as "ifTrue" and "ifFalse" and "[ ]" are used to enclosed blocks. We use "Transcript show" because otherwise a text will be printed enclosed like this 'This is a text' instead of This is a text. If you wonder about "value:", that's used to call a parameter.&lt;/p&gt;

&lt;p&gt;To compile, we're going to use GNU Smalltalk, that can be installed like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install gnu-smalltalk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and them simply...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gst "NAME_OF_FILE.st"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvawcsmwf79480n84iqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvawcsmwf79480n84iqb.png" alt="SmallTalk Exec" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read my Smalltalk Introduction &lt;a href="http://blagarts.com/static/GeekyThursday/Smalltalk_Introduction/smalltalk_Introduction.html#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it -:) Hope you had some fun -;) I had a lot of fun learning them...and they surely made me a better developer...and yes...I frustrated me plenty of times...but that's the fun of programming -;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blag.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>old</category>
      <category>tutorial</category>
      <category>motivation</category>
    </item>
  </channel>
</rss>
