SlideShare a Scribd company logo
API	
  Workshop




#delivered2012
Hi,	
  I’m	
  Swi3.
                 @SwiftAlphaOne
                 swift@sendgrid.com




#delivered2012
What	
  is	
  SendGrid?

 • Cloud-­‐based	
  SMTP	
  provider
 • Massively	
  scalable
 • AnalyCcs	
  on	
  emails	
  you	
  send
 • Robust	
  APIS	
  for	
  developers	
  to	
  integrate




#delivered2012
If	
  you	
  learn	
  1	
  thing...




 SendGrid	
  >	
  Email	
  Relay


#delivered2012
APIs	
  Overview
   What	
  APIs	
  does	
  SendGrid	
  Offer?
          • SMTP	
  API        • Subuser	
  API
          • Web	
  API         • CredenCals	
  API
          • NewsleNer	
  API   • Event	
  Webhook
          • Reseller	
  API    • Inbound	
  Parse	
  Webhook




                                    API

#delivered2012
APIs	
  Overview

  Q:	
  Why	
  should	
  I	
  care	
  about	
  the	
  SendGrid	
  APIs?

  A:	
  There	
  are	
  a	
  lot	
  of	
  reasons,	
  but	
  the	
  short	
  list	
  is...
     •	
  Reduce	
  code	
  complexity
     •	
  Deeper	
  analyCcs	
  &	
  tracking
     •	
  Less	
  resource	
  consumpCon
     •	
  BeNer	
  UX


#delivered2012
What	
  I	
  got	
  out	
  of	
  lunch



 Time is valuable.
Especially developer time.


#delivered2012
SMTP	
  API
   Custom	
  SMTP	
  header	
  that	
  contains	
  instrucCons	
  on	
  how	
  to	
  
   process	
  your	
  email

                         X-SMTPAPI: { ... }

   Add	
  extra	
  informaCon,	
  filters,	
  &	
  manipulaCons:
       •	
  Define	
  mulCple	
  recipients
       •	
  Text	
  SubsCtuCons
       •	
  Categories
       •	
  Unique	
  arguments	
  /	
  IdenCfiers


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




#delivered2012
Customer	
  Highlight
                                        qup.tv




 Queue,	
  rate,	
  or	
  watch	
  movies	
  on	
  Ne]lix	
  instant	
  with	
  one	
  click!

#delivered2012
Web	
  API
   Send	
  mail	
  or	
  manipulate	
  SendGrid	
  se_ngs	
  via	
  HTTP

   Anything	
  (almost)	
  you	
  can	
  do	
  from	
  the	
  SendGrid	
  
   dashboard,	
  you	
  can	
  do	
  from	
  the	
  Web	
  API
     •	
  Edit	
  profile	
  /	
  account	
  informaCon
     •	
  Add	
  new	
  Incoming	
  Parse	
  endpoints
     •	
  Retrieve	
  stats
     •	
  Manage	
  lists	
  (Bounces,	
  Blocks,	
  Unsubscribes,	
  etc.)
     •	
  Add	
  /	
  Remove	
  filters	
  (apps)
#delivered2012
Web	
  API
   Web	
  API	
  endpoints	
  have	
  the	
  following	
  format:
       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”



#delivered2012
Web	
  API	
  vs.	
  SMTP	
  API

  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
#delivered2012
NewsleEer	
  API
   Access	
  the	
  SendGrid	
  newsleNer	
  app	
  via	
  the	
  API
      https://sendgrid.com/api/newsletter/<ACTION>.<FORMAT>




   You	
  can	
  create	
  &	
  manage...
     •	
  NewsleNer	
  content
     •	
  Recipient	
  lists
     •	
  Sender	
  idenCCes
     •	
  Scheduled	
  deliveries

#delivered2012
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


#delivered2012
Event	
  No2fica2on	
  Webhook
   Receive notifications when SendGrid events happen


                                      POST



     •Processed   •Opened
     •Dropped     •Clicked                   Your	
  ApplicaCon	
  receives	
  
     •Delivered   •Spam	
  Reported                  an	
  event	
  POST
     •Bounced     •Unsubscribed                (like	
  a	
  form	
  submit)




#delivered2012
Event	
  No2fica2on	
  Webhook

          What does an event notification look like?

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


#delivered2012
Event	
  No2fica2on	
  Webhook

  Q:	
  Why	
  would	
  I	
  want	
  to	
  use	
  the	
  event	
  webhook?

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




#delivered2012
Inbound	
  Parse	
  Webhook

       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

#delivered2012
Customer	
  Highlight
                              thebirdy.com




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

#delivered2012
Inbound	
  Parse	
  Webhook

  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


#delivered2012
AddiGonal	
  APIs	
  

  Subuser	
  API
   •	
  Manage	
  and	
  control	
  subuser	
  accounts
  Reseller	
  API
   •	
  For	
  partners	
  who	
  want	
  to	
  integrate	
  their	
  pla]orm	
  with	
  SendGrid
  Mul2ple	
  Creden2als	
  API
  •	
  Add	
  new	
  API	
  keys	
  and	
  users	
  to	
  your	
  account



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




#delivered2012
Questions?


#delivered2012
Resources


 • DocumentaCon:	
  hNp://docs.sendgrid.com/
 • Official	
  Libraries:	
  hNps://github.com/sendgrid/
 • Support:	
  hNp://support.sendgrid.com/




#delivered2012
Swi3.
                 @SwiftAlphaOne
                 swift@sendgrid.com




#delivered2012

More Related Content

PPTX
2016 - Serverless Microservices on AWS with API Gateway and Lambda
PDF
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
PPTX
ESPC15 - Introduction to AngularJS in an Office 365 context
PDF
Crafting ColdFusion Applications like an Architect
PDF
Cooking your Ravioli "al dente" with Hexagonal Architecture
PDF
Intro firebase
PDF
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
PDF
CMPE282_009994036_PROJECT_REPORT
2016 - Serverless Microservices on AWS with API Gateway and Lambda
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
ESPC15 - Introduction to AngularJS in an Office 365 context
Crafting ColdFusion Applications like an Architect
Cooking your Ravioli "al dente" with Hexagonal Architecture
Intro firebase
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
CMPE282_009994036_PROJECT_REPORT

What's hot (19)

PDF
Building Event-Driven Serverless Applications
PDF
Our Hybrid Future: WordPress As Part of the Stack
PDF
AWS Serverless Workshop
PPTX
Introduction to google endpoints
PDF
Preparing for Data Residency and Custom Domains
PDF
Spec-first API Design for Speed and Safety
PDF
AngularJSTO presentation
PPTX
Creating a Custom PowerApp Connector using Azure Functions
KEY
2011 aug-gdd-mexico-city-high-replication-datastore
PPTX
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
PDF
Realtime Content Delivery: Powering dynamic instant experiences
KEY
2011 august-gdd-mexico-city-rest-json-oauth
PDF
Firebase Basics - Dialog Demo for Group Tech Staff
PPTX
MongoDB.local Atlanta: MongoDB Stitch Tutorial
PDF
mdevcon - A Primer to SyncAdapters
PDF
Android dev tips
PDF
AnDevCon - A Primer to Sync Adapters
PDF
iOSDevCamp Firebase Overview
PDF
Introduction to Firebase from Google
Building Event-Driven Serverless Applications
Our Hybrid Future: WordPress As Part of the Stack
AWS Serverless Workshop
Introduction to google endpoints
Preparing for Data Residency and Custom Domains
Spec-first API Design for Speed and Safety
AngularJSTO presentation
Creating a Custom PowerApp Connector using Azure Functions
2011 aug-gdd-mexico-city-high-replication-datastore
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
Realtime Content Delivery: Powering dynamic instant experiences
2011 august-gdd-mexico-city-rest-json-oauth
Firebase Basics - Dialog Demo for Group Tech Staff
MongoDB.local Atlanta: MongoDB Stitch Tutorial
mdevcon - A Primer to SyncAdapters
Android dev tips
AnDevCon - A Primer to Sync Adapters
iOSDevCamp Firebase Overview
Introduction to Firebase from Google
Ad

Viewers also liked (20)

PPTX
SendGridDelivered_Shades_of_Gray
KEY
Personal Productivity for Developers v3
PPTX
Build or Buy? Moving Your Email to the Cloud
PPTX
SendGridDelivered_transactional_email101
KEY
How to Get the Most Out Of Transactional Emails
PPTX
Make Transactional Email Your Superhero: Keys to Optimization and Testing Suc...
PPTX
Q&A: Your Toughest Email Infrastructure Questions Answered
PDF
[Webcast] Communicating Your Code
KEY
Best of Both Worlds: How SendGrid's Founder and CEO Work Together to Combine ...
PPTX
Shades of Gray: Incorporating Marketing into Transactional Email
PPTX
Q&A: Tips and Tricks to Stay Out of the Spam Folder
PPTX
[Webcast] How to Get Your Email Marketing Off the Ground
PPT
Ask an Expert! Getting Started with Email Deliverability
PDF
Tips and Tricks to Stay Out of the Spam Folder
PPTX
Email Deliverability 101: Best Practices to Master the Inbox
PPTX
ISPs Like It Hot: How to Warm Up an IP
PDF
Email Marketing 101: Who are you emailing?
PDF
Email Marketing Presentation
PPTX
Be an Email Switch Hitter: Inside SendGrid's Parse Webhook
PDF
Your Holiday Email Pre-Send Checklist
SendGridDelivered_Shades_of_Gray
Personal Productivity for Developers v3
Build or Buy? Moving Your Email to the Cloud
SendGridDelivered_transactional_email101
How to Get the Most Out Of Transactional Emails
Make Transactional Email Your Superhero: Keys to Optimization and Testing Suc...
Q&A: Your Toughest Email Infrastructure Questions Answered
[Webcast] Communicating Your Code
Best of Both Worlds: How SendGrid's Founder and CEO Work Together to Combine ...
Shades of Gray: Incorporating Marketing into Transactional Email
Q&A: Tips and Tricks to Stay Out of the Spam Folder
[Webcast] How to Get Your Email Marketing Off the Ground
Ask an Expert! Getting Started with Email Deliverability
Tips and Tricks to Stay Out of the Spam Folder
Email Deliverability 101: Best Practices to Master the Inbox
ISPs Like It Hot: How to Warm Up an IP
Email Marketing 101: Who are you emailing?
Email Marketing Presentation
Be an Email Switch Hitter: Inside SendGrid's Parse Webhook
Your Holiday Email Pre-Send Checklist
Ad

Similar to SendGridDelivered_API_Workshop (20)

KEY
SendGrid Delivered API Workshop
PPTX
#SPFestSea azr302 The SharePoint Framework and the #MicrosoftGraph under ster...
PDF
Frontend APIs powering fast paced product iterations
PPTX
MongoDB Stitch Introduction
PPTX
Lamdba micro service using Amazon Api Gateway
PPTX
Developing Apps with Azure AD
PPTX
SPS calgary 2017 introduction to azure functions microsoft flow
PDF
DevCom .NET Team
PDF
Bp101-Can Domino Be Hacked
PPTX
Integration with Dynamics 365 / Power Platform
PPTX
Building Your First App with MongoDB Stitch
PPTX
Standards-Based Low-Code Business Automation.pptx
PPTX
Tutorial: Building Your First App with MongoDB Stitch
PDF
API Security - OWASP top 10 for APIs + tips for pentesters
PPTX
Connector API Apps
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
PPTX
How to build Simple yet powerful API.pptx
PPTX
Application Architecture April 2014
PDF
How to Build Front-End Web Apps that Scale - FutureJS
PDF
Office 365 in today's digital threats landscape: attacks & remedies from a ha...
SendGrid Delivered API Workshop
#SPFestSea azr302 The SharePoint Framework and the #MicrosoftGraph under ster...
Frontend APIs powering fast paced product iterations
MongoDB Stitch Introduction
Lamdba micro service using Amazon Api Gateway
Developing Apps with Azure AD
SPS calgary 2017 introduction to azure functions microsoft flow
DevCom .NET Team
Bp101-Can Domino Be Hacked
Integration with Dynamics 365 / Power Platform
Building Your First App with MongoDB Stitch
Standards-Based Low-Code Business Automation.pptx
Tutorial: Building Your First App with MongoDB Stitch
API Security - OWASP top 10 for APIs + tips for pentesters
Connector API Apps
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
How to build Simple yet powerful API.pptx
Application Architecture April 2014
How to Build Front-End Web Apps that Scale - FutureJS
Office 365 in today's digital threats landscape: attacks & remedies from a ha...

More from SendGrid (11)

PPTX
Email Expedition - Your First Marketing Send
PDF
The SendGrid Email Drink Menu
PDF
Supporting SDKs in Seven Different Programming Languages While Maintaining Sa...
PDF
The Intersection of DevRel and Product
PDF
Email Marketing 101: The Welcome Email
PDF
5 Reasons Why Your Subscribers Aren't Reading Your Email
PDF
Email Marketing 101: Strategy
PDF
Email Marketing 101: Content
PPT
TechStars Demo Day 2009
PPTX
Automate the Next Level of Email Sophistication: Engage the Event API
PDF
Tips and Tricks to Stay Out of the Spam Folder
Email Expedition - Your First Marketing Send
The SendGrid Email Drink Menu
Supporting SDKs in Seven Different Programming Languages While Maintaining Sa...
The Intersection of DevRel and Product
Email Marketing 101: The Welcome Email
5 Reasons Why Your Subscribers Aren't Reading Your Email
Email Marketing 101: Strategy
Email Marketing 101: Content
TechStars Demo Day 2009
Automate the Next Level of Email Sophistication: Engage the Event API
Tips and Tricks to Stay Out of the Spam Folder

SendGridDelivered_API_Workshop

  • 2. Hi,  I’m  Swi3. @SwiftAlphaOne swift@sendgrid.com #delivered2012
  • 3. What  is  SendGrid? • Cloud-­‐based  SMTP  provider • Massively  scalable • AnalyCcs  on  emails  you  send • Robust  APIS  for  developers  to  integrate #delivered2012
  • 4. If  you  learn  1  thing... SendGrid  >  Email  Relay #delivered2012
  • 5. APIs  Overview What  APIs  does  SendGrid  Offer? • SMTP  API • Subuser  API • Web  API • CredenCals  API • NewsleNer  API • Event  Webhook • Reseller  API • Inbound  Parse  Webhook API #delivered2012
  • 6. APIs  Overview Q:  Why  should  I  care  about  the  SendGrid  APIs? A:  There  are  a  lot  of  reasons,  but  the  short  list  is... •  Reduce  code  complexity •  Deeper  analyCcs  &  tracking •  Less  resource  consumpCon •  BeNer  UX #delivered2012
  • 7. What  I  got  out  of  lunch Time is valuable. Especially developer time. #delivered2012
  • 8. SMTP  API Custom  SMTP  header  that  contains  instrucCons  on  how  to   process  your  email X-SMTPAPI: { ... } Add  extra  informaCon,  filters,  &  manipulaCons: •  Define  mulCple  recipients •  Text  SubsCtuCons •  Categories •  Unique  arguments  /  IdenCfiers #delivered2012
  • 9. SMTP  API Example:  Billing  noCficaCon X-SMTPAPI: { "to": ["swift@sendgrid.com"], "category": "billing_notifications", "unique_args": { "user_id": "12345" }, "sub": { "%amount%": ["$9.95"] } } #delivered2012
  • 10. SMTP  API Example:  Billing  noCficaCon  (cont) #delivered2012
  • 11. Customer  Highlight qup.tv Queue,  rate,  or  watch  movies  on  Ne]lix  instant  with  one  click! #delivered2012
  • 12. Web  API Send  mail  or  manipulate  SendGrid  se_ngs  via  HTTP Anything  (almost)  you  can  do  from  the  SendGrid   dashboard,  you  can  do  from  the  Web  API •  Edit  profile  /  account  informaCon •  Add  new  Incoming  Parse  endpoints •  Retrieve  stats •  Manage  lists  (Bounces,  Blocks,  Unsubscribes,  etc.) •  Add  /  Remove  filters  (apps) #delivered2012
  • 13. Web  API Web  API  endpoints  have  the  following  format: 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” #delivered2012
  • 14. Web  API  vs.  SMTP  API 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 #delivered2012
  • 15. NewsleEer  API Access  the  SendGrid  newsleNer  app  via  the  API https://sendgrid.com/api/newsletter/<ACTION>.<FORMAT> You  can  create  &  manage... •  NewsleNer  content •  Recipient  lists •  Sender  idenCCes •  Scheduled  deliveries #delivered2012
  • 16. 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 #delivered2012
  • 17. Event  No2fica2on  Webhook Receive notifications when SendGrid events happen POST •Processed •Opened •Dropped •Clicked Your  ApplicaCon  receives   •Delivered •Spam  Reported an  event  POST •Bounced •Unsubscribed (like  a  form  submit) #delivered2012
  • 18. Event  No2fica2on  Webhook What does an event notification look like? { "email":"john@example.com", "timestamp": 1322000095, "unique_arg":"some argument", "event":"delivered" } #delivered2012
  • 19. Event  No2fica2on  Webhook Q:  Why  would  I  want  to  use  the  event  webhook? A:  Use  it  to  enhance  your  exisCng  email   funcConality  and  gain  smart  customer  insight. (It’s a very reactive API) #delivered2012
  • 20. Inbound  Parse  Webhook 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 #delivered2012
  • 21. Customer  Highlight thebirdy.com Answer  one  email  a  day,  and  track  what  you  spend.  Create   categories  by  tagging  your  purchases  like  #twiNer.  Super  simple. #delivered2012
  • 22. Inbound  Parse  Webhook 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 #delivered2012
  • 23. AddiGonal  APIs   Subuser  API •  Manage  and  control  subuser  accounts Reseller  API •  For  partners  who  want  to  integrate  their  pla]orm  with  SendGrid Mul2ple  Creden2als  API •  Add  new  API  keys  and  users  to  your  account #delivered2012
  • 24. Demo Time! http://github.com/theycallmeswift #delivered2012
  • 26. Resources • DocumentaCon:  hNp://docs.sendgrid.com/ • Official  Libraries:  hNps://github.com/sendgrid/ • Support:  hNp://support.sendgrid.com/ #delivered2012
  • 27. Swi3. @SwiftAlphaOne swift@sendgrid.com #delivered2012