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 • Rob...
If	  you	  learn	  1	  thing... SendGrid	  >	  Email	  Relay#delivered2012
APIs	  Overview   What	  APIs	  does	  SendGrid	  Offer?          • SMTP	  API        • Subuser	  API          • Web	  API ...
APIs	  Overview  Q:	  Why	  should	  I	  care	  about	  the	  SendGrid	  APIs?  A:	  There	  are	  a	  lot	  of	  reasons,...
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           ...
SMTP	  API Example:	  Billing	  noCficaCon     X-SMTPAPI: {       "to": ["swift@sendgrid.com"],       "category": "billing_...
SMTP	  API Example:	  Billing	  noCficaCon	  (cont)#delivered2012
Customer	  Highlight                                        qup.tv Queue,	  rate,	  or	  watch	  movies	  on	  Ne]lix	  in...
Web	  API   Send	  mail	  or	  manipulate	  SendGrid	  se_ngs	  via	  HTTP   Anything	  (almost)	  you	  can	  do	  from	 ...
Web	  API   Web	  API	  endpoints	  have	  the	  following	  format:       https://sendgrid.com/api/<MODULE>.<ACTION>.<FOR...
Web	  API	  vs.	  SMTP	  API  Q:	  Why	  would	  I	  use	  HTTP	  instead	  of	  SMTP?   (Don’t worry, this is a really co...
NewsleEer	  API   Access	  the	  SendGrid	  newsleNer	  app	  via	  the	  API      https://sendgrid.com/api/newsletter/<AC...
Webhooks  Q:	  What	  are	  Webhooks?  A:	  Webhooks	  are	  like	  inverse	  API	  calls;	  you	  tell	  us	    where	  t...
Event	  No2fica2on	  Webhook   Receive notifications when SendGrid events happen                                      POST  ...
Event	  No2fica2on	  Webhook          What does an event notification look like?           {                 "email":"john@e...
Event	  No2fica2on	  Webhook  Q:	  Why	  would	  I	  want	  to	  use	  the	  event	  webhook?  A:	  Use	  it	  to	  enhance...
Inbound	  Parse	  Webhook       Lets you receive email in your application                   EMAIL                POST    ...
Customer	  Highlight                              thebirdy.com Answer	  one	  email	  a	  day,	  and	  track	  what	  you	...
Inbound	  Parse	  Webhook  1. Configure your hostname and URL settings        http://sendgrid.com/developer/reply  2. Point...
AddiGonal	  APIs	    Subuser	  API   •	  Manage	  and	  control	  subuser	  accounts  Reseller	  API   •	  For	  partners	...
Demo Time!                 http://github.com/theycallmeswift#delivered2012
Questions?#delivered2012
Resources • DocumentaCon:	  hNp://docs.sendgrid.com/ • Official	  Libraries:	  hNps://github.com/sendgrid/ • Support:	  hNp:...
Swi3.                 @SwiftAlphaOne                 swift@sendgrid.com#delivered2012
Upcoming SlideShare
Loading in …5
×

SendGridDelivered_API_Workshop

454
-1

Published on

Developer Evangelist Swift delivers great info, examples, and demos of SendGrid's API's

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
454
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

SendGridDelivered_API_Workshop

  1. 1. API  Workshop#delivered2012
  2. 2. Hi,  I’m  Swi3. @SwiftAlphaOne swift@sendgrid.com#delivered2012
  3. 3. What  is  SendGrid? • Cloud-­‐based  SMTP  provider • Massively  scalable • AnalyCcs  on  emails  you  send • Robust  APIS  for  developers  to  integrate#delivered2012
  4. 4. If  you  learn  1  thing... SendGrid  >  Email  Relay#delivered2012
  5. 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. 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. 7. What  I  got  out  of  lunch Time is valuable.Especially developer time.#delivered2012
  8. 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. 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. 10. SMTP  API Example:  Billing  noCficaCon  (cont)#delivered2012
  11. 11. Customer  Highlight qup.tv Queue,  rate,  or  watch  movies  on  Ne]lix  instant  with  one  click!#delivered2012
  12. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 24. Demo Time! http://github.com/theycallmeswift#delivered2012
  25. 25. Questions?#delivered2012
  26. 26. Resources • DocumentaCon:  hNp://docs.sendgrid.com/ • Official  Libraries:  hNps://github.com/sendgrid/ • Support:  hNp://support.sendgrid.com/#delivered2012
  27. 27. Swi3. @SwiftAlphaOne swift@sendgrid.com#delivered2012
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×