SlideShare a Scribd company logo
1 of 73
API Workshop




#SGDelivered
Hi, I’m Brandon.
               @brandonmwest
               brandon.west@sendgrid.com




#SGDelivered
What is SendGrid?




#SGDelivered
What is SendGrid?

 • Cloud-based SMTP provider




#SGDelivered
What is SendGrid?

 • Cloud-based SMTP provider
 • Massively scalable




#SGDelivered
What is SendGrid?

 • Cloud-based SMTP provider
 • Massively scalable
 • Analytics on emails you send




#SGDelivered
What is SendGrid?

 • Cloud-based SMTP provider
 • Massively scalable
 • Analytics on emails you send
 • Robust APIs for developers to integrate




#SGDelivered
If you learn 1 thing...




 SendGrid > Email
 Relay
#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?




#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?

  A: There are a lot of reasons, but the




#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?

  A: There are a lot of reasons, but the
     • Reduce code complexity




#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?

  A: There are a lot of reasons, but the
     • Reduce code complexity
     • Deeper analytics & tracking




#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?

  A: There are a lot of reasons, but the
     • Reduce code complexity
     • Deeper analytics & tracking
     • Less resource consumption




#SGDelivered
APIs Overview

  Q: Why should I care about the SendGrid APIs?

  A: There are a lot of reasons, but the
     • Reduce code complexity
     • Deeper analytics & tracking
     • Less resource consumption
     • Better UX


#SGDelivered
Why Use SendGrid?



 Time is valuable.
Especially developer time.


#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?




                      API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API




                        API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API
          • Web API




                        API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API
          • Web API
          • Newsletter API




                              API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API
          • Web API
          • Newsletter API
          • Reseller API




                              API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API         • Subuser API
          • Web API
          • Newsletter API
          • Reseller API




                                API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API         • Subuser API
          • Web API          • Credentials API
          • Newsletter API
          • Reseller API




                                API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API      • Subuser API
          • Web API       • Credentials API
          • Newsletter API • Event Webhook
          • Reseller API




                              API

#SGDelivered
APIs Overview
   What APIs does SendGrid Offer?
          • SMTP API      • Subuser API
          • Web API       • Credentials API
          • Newsletter API • Event Webhook
          • Reseller API   • Inbound Parse Webhook




                             API

#SGDelivered
SMTP API
   Custom SMTP header that contains instructions on
   how to process your email

                X-SMTPAPI: { ... }

   Add extra information, filters, & manipulations:




#SGDelivered
SMTP API
   Custom SMTP header that contains instructions on
   how to process your email

                  X-SMTPAPI: { ... }

   Add extra information, filters, & manipulations:
       • Define multiple recipients




#SGDelivered
SMTP API
   Custom SMTP header that contains instructions on
   how to process your email

                  X-SMTPAPI: { ... }

   Add extra information, filters, & manipulations:
       • Define multiple recipients
       • Text Substitutions




#SGDelivered
SMTP API
   Custom SMTP header that contains instructions on
   how to process your email

                  X-SMTPAPI: { ... }

   Add extra information, filters, & manipulations:
       • Define multiple recipients
       • Text Substitutions
       • Categories



#SGDelivered
SMTP API
   Custom SMTP header that contains instructions on
   how to process your email

                  X-SMTPAPI: { ... }

   Add extra information, filters, & manipulations:
       • Define multiple recipients
       • Text Substitutions
       • Categories
       • Unique arguments / Identifiers


#SGDelivered
SMTP API
 Example: Billing notification
     X-SMTPAPI: {
       "to": ["brandon.west@sendgrid.com"],
       "category": "billing_notifications",
       "unique_args": {
          "user_id": "12345"
       },
       "sub": {
          "%amount%": ["$9.95"]
       }
     }
#SGDelivered
SMTP API
 Example: Billing notification (cont)




#SGDelivered
Metadata from Rails

 # Set headers for SendGrid.
 def add_sendgrid_headers(action, args)
   mailer = self.class.name
   args = Hash[ method(action).parameters.map(&:last).zip(args) ]
   headers "X-SMTPAPI" => {
     category:    [ mailer, "#{mailer}##{action}" ],
     unique_args: { environment: Rails.env, arguments: args.inspect }
   }.to_json
 end




#SGDelivered
Metadata from Rails
class ApplicationMailer < ActionMailer::Base
  # Call add_sendgrid_headers after generating each mail.
  def initialize(method_name=nil, *args)
    super.tap do
      add_sendgrid_headers(method_name, args) if method_name
    end
  end

  private

  # Set headers for SendGrid.
  def add_sendgrid_headers(action, args)
    mailer = self.class.name
    args = Hash[ method(action).parameters.map(&:last).zip(args) ]
    headers "X-SMTPAPI" => {
      category:    [ mailer, "#{mailer}##{action}" ],
      unique_args: { environment: Rails.env, arguments: args.inspect }
    }.to_json
  end
end

#SGDelivered
Rails Metadata




#SGDelivered
Customer Highlight
                      qup.tv




 Queue, rate, or watch movies on Netflix instant with
 one click!
#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the




#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the
     • Edit profile / account information




#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the
     • Edit profile / account information
     • Add new Incoming Parse endpoints



#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the
     • Edit profile / account information
     • Add new Incoming Parse endpoints
     • Retrieve stats


#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the
     • Edit profile / account information
     • Add new Incoming Parse endpoints
     • Retrieve stats
     • Manage lists (Bounces, Blocks, Unsubscribes, etc.)

#SGDelivered
Web API
   Send mail or manipulate SendGrid settings
   via HTTP

   Anything (almost) you can do from the
     • Edit profile / account information
     • Add new Incoming Parse endpoints
     • Retrieve stats
     • Manage lists (Bounces, Blocks, Unsubscribes, etc.)
     • Add / Remove filters (apps)
#SGDelivered
Web API
   Web API endpoints have the following
       https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT>




#SGDelivered
Web API
   Web API endpoints have the following
       https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT>


   Example: Send Email over HTTP




#SGDelivered
Web API
   Web API endpoints have the following
       https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT>


   Example: Send Email over HTTP
       curl    -X POST http://sendgrid.com/api/mail.send.json 
         -d    “to=john@example.com” 
         -d    “from=hello@myapp.com” 
         -d    “subject=hello world email” 
         -d    “text=some body text” 
         -d    “api_user=your_sendgrid_username” 
         -d    “api_key=your_sendgrid_key”



#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)




#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)


  A: Normally, you won’t have to. Unless...




#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)


  A: Normally, you won’t have to. Unless...
     • Your ISP is blocking common SMTP ports




#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)


  A: Normally, you won’t have to. Unless...
     • Your ISP is blocking common SMTP ports
     • There is high latency between your app and
     SendGrid


#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)


  A: Normally, you won’t have to. Unless...
     • Your ISP is blocking common SMTP ports
     • There is high latency between your app and
     SendGrid
     • Difficult to install / configure SMTP drivers
#SGDelivered
Web API vs. SMTP

  Q: Why would I use HTTP instead of SMTP?
   (Don’t worry, this is a really common question)


  A: Normally, you won’t have to. Unless...
     • Your ISP is blocking common SMTP ports
     • There is high latency between your app and
     SendGrid
     • Difficult to install / configure SMTP drivers
     • Simplicity for developers
#SGDelivered
Newsletter API
   Access the SendGrid newsletter app via the
   API
    https://sendgrid.com/api/newsletter/<ACTION>.<FORMAT>




     • Newsletter content
     • Recipient lists
     • Sender identities
     • Scheduled deliveries

#SGDelivered
Webhooks

  Q: What are Webhooks?




                 WEB
                HOOK


#SGDelivered
Webhooks

  Q: What are Webhooks?

  A: Webhooks are like inverse API calls;
  you tell us where the data needs to go,
  we send it there.

                   WEB
                  HOOK


#SGDelivered
Event Notification
  Receive notifications when SendGrid events happen


                    HTTP POST
                  (like a form submit)




#SGDelivered
Event Notification
  Receive notifications when SendGrid events happen


                            HTTP POST
                       (like a form submit)




               •Processed       •Opened
               •Dropped         •Clicked
               •Delivered       •Spam Reported
               •Bounced         •Unsubscribed



#SGDelivered
Event Notification

         What does an event notification look like?

           {
               "email":"john@example.com",
               "timestamp": 1322000095,
               "unique_arg":"some argument",
               "event":"delivered"
           }


#SGDelivered
Event Notification

  Q: Why would I want to use the event

  A: Use it to enhance your existing email
  functionality and gain smart customer
  insight. reactive API)
  (It’s a very




#SGDelivered
Inbound Parse

       Lets you receive email in your application


                  EMAIL              POST




#SGDelivered
Inbound Parse

       Lets you receive email in your application


                   EMAIL                POST




       1. User sends email to *@yourapplication.com
       2. SendGrid parses email & attachments
       3. SendGrid POSTs the email to your application

#SGDelivered
Customer Highlight
                 thebirdy.com




 Answer one email a day, and track what you spend.
 Create categories by tagging your purchases like
 #twitter. Super simple.
#SGDelivered
Inbound Parse

  1. Configure your hostname and URL settings

       http://sendgrid.com/developer/reply

  2. Point your domain’s MX records at SendGrid

          Type    Value
          MX      0 mx.sendgrid.net
  3. Return a 200 status code from your application


#SGDelivered
Additional APIs




#SGDelivered
Additional APIs

  Subuser API




#SGDelivered
Additional APIs

  Subuser API
   • Manage and control subuser accounts




#SGDelivered
Additional APIs

  Subuser API
   • Manage and control subuser accounts
  Reseller API




#SGDelivered
Additional APIs

  Subuser API
   • Manage and control subuser accounts
  Reseller API
   • For partners who want to integrate their platform with
   SendGrid




#SGDelivered
Additional APIs

  Subuser API
   • Manage and control subuser accounts
  Reseller API
   • For partners who want to integrate their platform with
   SendGrid
  Multiple Credentials API




#SGDelivered
Additional APIs

  Subuser API
   • Manage and control subuser accounts
  Reseller API
   • For partners who want to integrate their platform with
   SendGrid
  Multiple Credentials API
  • Add new API keys and users to your account



#SGDelivered
Demo Time!
               http://github.com/theycallmeswift




#SGDelivered
Questions?


#SGDelivered
Resources


 • Documentation/API Workshop:
   http://docs.sendgrid.com/

 • Official Libraries: https://github.com/
   sendgrid/
 • Support: http://support.sendgrid.com/


#SGDelivered
Thanks!
               @brandonmwest
               brandon.west@sendgrid.com




#SGDelivered

More Related Content

Similar to SendGrid Delivered API Workshop

SendGridDelivered_API_Workshop
SendGridDelivered_API_WorkshopSendGridDelivered_API_Workshop
SendGridDelivered_API_WorkshopSendGrid
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayVadim Zendejas
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with GrailsTanausu Cerdeña
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gatewayaws-marketing-il
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...Amazon Web Services
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...Amazon Web Services
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDKMooYeol Lee
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbsAWS Chicago
 
Ai lifecycle and navigator
Ai lifecycle and navigatorAi lifecycle and navigator
Ai lifecycle and navigatoraiclub_slides
 
Serverless — it all started in Vegas
Serverless — it all started in VegasServerless — it all started in Vegas
Serverless — it all started in VegasMartin Buberl
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterSachin G Kulkarni
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays
 

Similar to SendGrid Delivered API Workshop (20)

SendGridDelivered_API_Workshop
SendGridDelivered_API_WorkshopSendGridDelivered_API_Workshop
SendGridDelivered_API_Workshop
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with Grails
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDK
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 
Ai lifecycle and navigator
Ai lifecycle and navigatorAi lifecycle and navigator
Ai lifecycle and navigator
 
API Design Workflows
API Design WorkflowsAPI Design Workflows
API Design Workflows
 
Serverless — it all started in Vegas
Serverless — it all started in VegasServerless — it all started in Vegas
Serverless — it all started in Vegas
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
CGI Presentation
CGI PresentationCGI Presentation
CGI Presentation
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

SendGrid Delivered API Workshop

  • 2. Hi, I’m Brandon. @brandonmwest brandon.west@sendgrid.com #SGDelivered
  • 4. What is SendGrid? • Cloud-based SMTP provider #SGDelivered
  • 5. What is SendGrid? • Cloud-based SMTP provider • Massively scalable #SGDelivered
  • 6. What is SendGrid? • Cloud-based SMTP provider • Massively scalable • Analytics on emails you send #SGDelivered
  • 7. What is SendGrid? • Cloud-based SMTP provider • Massively scalable • Analytics on emails you send • Robust APIs for developers to integrate #SGDelivered
  • 8.
  • 9. If you learn 1 thing... SendGrid > Email Relay #SGDelivered
  • 10. APIs Overview Q: Why should I care about the SendGrid APIs? #SGDelivered
  • 11. APIs Overview Q: Why should I care about the SendGrid APIs? A: There are a lot of reasons, but the #SGDelivered
  • 12. APIs Overview Q: Why should I care about the SendGrid APIs? A: There are a lot of reasons, but the • Reduce code complexity #SGDelivered
  • 13. APIs Overview Q: Why should I care about the SendGrid APIs? A: There are a lot of reasons, but the • Reduce code complexity • Deeper analytics & tracking #SGDelivered
  • 14. APIs Overview Q: Why should I care about the SendGrid APIs? A: There are a lot of reasons, but the • Reduce code complexity • Deeper analytics & tracking • Less resource consumption #SGDelivered
  • 15. APIs Overview Q: Why should I care about the SendGrid APIs? A: There are a lot of reasons, but the • Reduce code complexity • Deeper analytics & tracking • Less resource consumption • Better UX #SGDelivered
  • 16. Why Use SendGrid? Time is valuable. Especially developer time. #SGDelivered
  • 17. APIs Overview What APIs does SendGrid Offer? API #SGDelivered
  • 18. APIs Overview What APIs does SendGrid Offer? • SMTP API API #SGDelivered
  • 19. APIs Overview What APIs does SendGrid Offer? • SMTP API • Web API API #SGDelivered
  • 20. APIs Overview What APIs does SendGrid Offer? • SMTP API • Web API • Newsletter API API #SGDelivered
  • 21. APIs Overview What APIs does SendGrid Offer? • SMTP API • Web API • Newsletter API • Reseller API API #SGDelivered
  • 22. APIs Overview What APIs does SendGrid Offer? • SMTP API • Subuser API • Web API • Newsletter API • Reseller API API #SGDelivered
  • 23. APIs Overview What APIs does SendGrid Offer? • SMTP API • Subuser API • Web API • Credentials API • Newsletter API • Reseller API API #SGDelivered
  • 24. APIs Overview What APIs does SendGrid Offer? • SMTP API • Subuser API • Web API • Credentials API • Newsletter API • Event Webhook • Reseller API API #SGDelivered
  • 25. APIs Overview What APIs does SendGrid Offer? • SMTP API • Subuser API • Web API • Credentials API • Newsletter API • Event Webhook • Reseller API • Inbound Parse Webhook API #SGDelivered
  • 26. SMTP API Custom SMTP header that contains instructions on how to process your email X-SMTPAPI: { ... } Add extra information, filters, & manipulations: #SGDelivered
  • 27. SMTP API Custom SMTP header that contains instructions on how to process your email X-SMTPAPI: { ... } Add extra information, filters, & manipulations: • Define multiple recipients #SGDelivered
  • 28. SMTP API Custom SMTP header that contains instructions on how to process your email X-SMTPAPI: { ... } Add extra information, filters, & manipulations: • Define multiple recipients • Text Substitutions #SGDelivered
  • 29. SMTP API Custom SMTP header that contains instructions on how to process your email X-SMTPAPI: { ... } Add extra information, filters, & manipulations: • Define multiple recipients • Text Substitutions • Categories #SGDelivered
  • 30. SMTP API Custom SMTP header that contains instructions on how to process your email X-SMTPAPI: { ... } Add extra information, filters, & manipulations: • Define multiple recipients • Text Substitutions • Categories • Unique arguments / Identifiers #SGDelivered
  • 31. SMTP API Example: Billing notification X-SMTPAPI: { "to": ["brandon.west@sendgrid.com"], "category": "billing_notifications", "unique_args": { "user_id": "12345" }, "sub": { "%amount%": ["$9.95"] } } #SGDelivered
  • 32. SMTP API Example: Billing notification (cont) #SGDelivered
  • 33. Metadata from Rails # Set headers for SendGrid. def add_sendgrid_headers(action, args) mailer = self.class.name args = Hash[ method(action).parameters.map(&:last).zip(args) ] headers "X-SMTPAPI" => { category: [ mailer, "#{mailer}##{action}" ], unique_args: { environment: Rails.env, arguments: args.inspect } }.to_json end #SGDelivered
  • 34. Metadata from Rails class ApplicationMailer < ActionMailer::Base # Call add_sendgrid_headers after generating each mail. def initialize(method_name=nil, *args) super.tap do add_sendgrid_headers(method_name, args) if method_name end end private # Set headers for SendGrid. def add_sendgrid_headers(action, args) mailer = self.class.name args = Hash[ method(action).parameters.map(&:last).zip(args) ] headers "X-SMTPAPI" => { category: [ mailer, "#{mailer}##{action}" ], unique_args: { environment: Rails.env, arguments: args.inspect } }.to_json end end #SGDelivered
  • 36. Customer Highlight qup.tv Queue, rate, or watch movies on Netflix instant with one click! #SGDelivered
  • 37. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the #SGDelivered
  • 38. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the • Edit profile / account information #SGDelivered
  • 39. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the • Edit profile / account information • Add new Incoming Parse endpoints #SGDelivered
  • 40. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the • Edit profile / account information • Add new Incoming Parse endpoints • Retrieve stats #SGDelivered
  • 41. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the • Edit profile / account information • Add new Incoming Parse endpoints • Retrieve stats • Manage lists (Bounces, Blocks, Unsubscribes, etc.) #SGDelivered
  • 42. Web API Send mail or manipulate SendGrid settings via HTTP Anything (almost) you can do from the • Edit profile / account information • Add new Incoming Parse endpoints • Retrieve stats • Manage lists (Bounces, Blocks, Unsubscribes, etc.) • Add / Remove filters (apps) #SGDelivered
  • 43. Web API Web API endpoints have the following https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT> #SGDelivered
  • 44. Web API Web API endpoints have the following https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT> Example: Send Email over HTTP #SGDelivered
  • 45. Web API Web API endpoints have the following https://sendgrid.com/api/<MODULE>.<ACTION>.<FORMAT> Example: Send Email over HTTP curl -X POST http://sendgrid.com/api/mail.send.json -d “to=john@example.com” -d “from=hello@myapp.com” -d “subject=hello world email” -d “text=some body text” -d “api_user=your_sendgrid_username” -d “api_key=your_sendgrid_key” #SGDelivered
  • 46. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) #SGDelivered
  • 47. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) A: Normally, you won’t have to. Unless... #SGDelivered
  • 48. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) A: Normally, you won’t have to. Unless... • Your ISP is blocking common SMTP ports #SGDelivered
  • 49. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) A: Normally, you won’t have to. Unless... • Your ISP is blocking common SMTP ports • There is high latency between your app and SendGrid #SGDelivered
  • 50. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) A: Normally, you won’t have to. Unless... • Your ISP is blocking common SMTP ports • There is high latency between your app and SendGrid • Difficult to install / configure SMTP drivers #SGDelivered
  • 51. Web API vs. SMTP Q: Why would I use HTTP instead of SMTP? (Don’t worry, this is a really common question) A: Normally, you won’t have to. Unless... • Your ISP is blocking common SMTP ports • There is high latency between your app and SendGrid • Difficult to install / configure SMTP drivers • Simplicity for developers #SGDelivered
  • 52. Newsletter API Access the SendGrid newsletter app via the API https://sendgrid.com/api/newsletter/<ACTION>.<FORMAT> • Newsletter content • Recipient lists • Sender identities • Scheduled deliveries #SGDelivered
  • 53. Webhooks Q: What are Webhooks? WEB HOOK #SGDelivered
  • 54. Webhooks Q: What are Webhooks? A: Webhooks are like inverse API calls; you tell us where the data needs to go, we send it there. WEB HOOK #SGDelivered
  • 55. Event Notification Receive notifications when SendGrid events happen HTTP POST (like a form submit) #SGDelivered
  • 56. Event Notification Receive notifications when SendGrid events happen HTTP POST (like a form submit) •Processed •Opened •Dropped •Clicked •Delivered •Spam Reported •Bounced •Unsubscribed #SGDelivered
  • 57. Event Notification What does an event notification look like? { "email":"john@example.com", "timestamp": 1322000095, "unique_arg":"some argument", "event":"delivered" } #SGDelivered
  • 58. Event Notification Q: Why would I want to use the event A: Use it to enhance your existing email functionality and gain smart customer insight. reactive API) (It’s a very #SGDelivered
  • 59. Inbound Parse Lets you receive email in your application EMAIL POST #SGDelivered
  • 60. Inbound Parse Lets you receive email in your application EMAIL POST 1. User sends email to *@yourapplication.com 2. SendGrid parses email & attachments 3. SendGrid POSTs the email to your application #SGDelivered
  • 61. Customer Highlight thebirdy.com Answer one email a day, and track what you spend. Create categories by tagging your purchases like #twitter. Super simple. #SGDelivered
  • 62. Inbound Parse 1. Configure your hostname and URL settings http://sendgrid.com/developer/reply 2. Point your domain’s MX records at SendGrid Type Value MX 0 mx.sendgrid.net 3. Return a 200 status code from your application #SGDelivered
  • 64. Additional APIs Subuser API #SGDelivered
  • 65. Additional APIs Subuser API • Manage and control subuser accounts #SGDelivered
  • 66. Additional APIs Subuser API • Manage and control subuser accounts Reseller API #SGDelivered
  • 67. Additional APIs Subuser API • Manage and control subuser accounts Reseller API • For partners who want to integrate their platform with SendGrid #SGDelivered
  • 68. Additional APIs Subuser API • Manage and control subuser accounts Reseller API • For partners who want to integrate their platform with SendGrid Multiple Credentials API #SGDelivered
  • 69. Additional APIs Subuser API • Manage and control subuser accounts Reseller API • For partners who want to integrate their platform with SendGrid Multiple Credentials API • Add new API keys and users to your account #SGDelivered
  • 70. Demo Time! http://github.com/theycallmeswift #SGDelivered
  • 72. Resources • Documentation/API Workshop: http://docs.sendgrid.com/ • Official Libraries: https://github.com/ sendgrid/ • Support: http://support.sendgrid.com/ #SGDelivered
  • 73. Thanks! @brandonmwest brandon.west@sendgrid.com #SGDelivered

Editor's Notes

  1. \n
  2. \n
  3. Scalable: thousands of emails per second, hundreds of millions per day, billions per month\n
  4. Scalable: thousands of emails per second, hundreds of millions per day, billions per month\n
  5. Scalable: thousands of emails per second, hundreds of millions per day, billions per month\n
  6. Scalable: thousands of emails per second, hundreds of millions per day, billions per month\n
  7. Install a gem called pony\nset some defaults\nconstruct a message and send it\ncheck that the email arrived\n
  8. \n
  9. - less logic in your code that triggers mailers\n - Events, stats, real-time\n - Scheduling and multiple recipients reduce need for worker\n - Respond to messages from inbox\n
  10. - less logic in your code that triggers mailers\n - Events, stats, real-time\n - Scheduling and multiple recipients reduce need for worker\n - Respond to messages from inbox\n
  11. - less logic in your code that triggers mailers\n - Events, stats, real-time\n - Scheduling and multiple recipients reduce need for worker\n - Respond to messages from inbox\n
  12. - less logic in your code that triggers mailers\n - Events, stats, real-time\n - Scheduling and multiple recipients reduce need for worker\n - Respond to messages from inbox\n
  13. - less logic in your code that triggers mailers\n - Events, stats, real-time\n - Scheduling and multiple recipients reduce need for worker\n - Respond to messages from inbox\n
  14. Story about how/why the company was founded\nDevelopers are doers, so if they need to send email, they&amp;#x2019;re likely to fall down an email configuration rabbit hole and disappear\n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. These categories and arguments are also passed as part of our event webhook, so it&amp;#x2019;s pretty easy to create a local archive of all mail events.\n
  32. From Hack the Midwest, Kansas City, June 2012.\n
  33. Apps example -- for password resets, bypass list management\n
  34. Apps example -- for password resets, bypass list management\n
  35. Apps example -- for password resets, bypass list management\n
  36. Apps example -- for password resets, bypass list management\n
  37. Apps example -- for password resets, bypass list management\n
  38. \n
  39. \n
  40. - Best setup is to set up a local mail server that queues up messages and then relays through SendGrid\n - Handing your email off to fault tolerant machines\n - Graceful queuing and resending\n - Connection reuse and pipelining\n
  41. - Best setup is to set up a local mail server that queues up messages and then relays through SendGrid\n - Handing your email off to fault tolerant machines\n - Graceful queuing and resending\n - Connection reuse and pipelining\n
  42. - Best setup is to set up a local mail server that queues up messages and then relays through SendGrid\n - Handing your email off to fault tolerant machines\n - Graceful queuing and resending\n - Connection reuse and pipelining\n
  43. - Best setup is to set up a local mail server that queues up messages and then relays through SendGrid\n - Handing your email off to fault tolerant machines\n - Graceful queuing and resending\n - Connection reuse and pipelining\n
  44. - Best setup is to set up a local mail server that queues up messages and then relays through SendGrid\n - Handing your email off to fault tolerant machines\n - Graceful queuing and resending\n - Connection reuse and pipelining\n
  45. \n
  46. \n
  47. Limits of the &amp;#x201C;spam report&amp;#x201D; events - not all providers, such as gmail, let us listen to that feedback loop.\nLimits of &amp;#x201C;open tracking&amp;#x201D; - requires an image to be displayed.\n
  48. \n
  49. - Job application example\n- React to bounces on the fly\n- Analyze user behavior and optimize\n- Red alerts\n
  50. Possible use cases:\n - Respond to discussions\n - Upload file attachments\n - Post blog articles\n
  51. \n
  52. \n
  53. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  54. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  55. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  56. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  57. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  58. Subuser use case - Someone that wants to manage their clients individually for stats, etc\nReseller use case - Windows Azure, Heroku, etc\nMultiple Credentials use case - EVERYONE should use this.\n
  59. API Workshop demo\nSwift&amp;#x2019;s Playlist Demo\n
  60. \n
  61. \n
  62. \n