baranka

Email Sender API Documentation

Apr 10th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.34 KB | Source Code | 0 0
  1. Overview
  2. The Email Sender API from LetsExtract allows you to send emails programmatically. With this API, you can send personalized emails, manage email templates, and track email statuses with ease. It is designed for developers looking to integrate email capabilities into their applications efficiently.
  3.  
  4. Endpoint
  5. The base URL for the Email Sender API is as follows:
  6.  
  7. https://api.letsextract.com/v1/send-email
  8. Request Method
  9. This API uses the POST method to submit email sending requests.
  10.  
  11. Request Body
  12. The request body should be in JSON format and include the following fields:
  13.  
  14. to: (string) The recipient's email address. (Required)
  15. subject: (string) The subject of the email. (Required)
  16. body: (string) The content of the email. (Required)
  17. from: (string) The sender's email address. (Optional)
  18. attachments: (array) A list of file URLs to include as attachments. (Optional)
  19. Example Request
  20. Here’s an example JSON request to send an email using the Email Sender API:
  21.  
  22. {
  23.   "to": "[email protected]",
  24.   "subject": "Welcome to LetsExtract!",
  25.   "body": "Hello, \n\nThank you for signing up for LetsExtract. We are excited to have you on board! \n\nBest regards, \nThe LetsExtract Team",
  26.   "from": "[email protected]",
  27.   "attachments": ["https://example.com/file1.pdf", "https://example.com/file2.jpg"]
  28. }
  29. cURL Example
  30. You can use the following cURL command to send an email using the API:
  31.  
  32. curl -X POST https://api.letsextract.com/v1/send-email \
  33. -H "Content-Type: application/json" \
  34. -H "Authorization: Bearer YOUR_API_KEY" \
  35. -d '{
  36.  "to": "[email protected]",
  37.  "subject": "Welcome to LetsExtract!",
  38.  "body": "Hello, \n\nThank you for signing up for LetsExtract. We are excited to have you on board! \n\nBest regards, \nThe LetsExtract Team",
  39.  "from": "[email protected]",
  40.  "attachments": ["https://example.com/file1.pdf", "https://example.com/file2.jpg"]
  41. }'
  42. Response
  43. A successful response will look like this:
  44.  
  45. {
  46.   "status": "success",
  47.   "data": {
  48.     "email_id": "123456",
  49.     "message": "Email sent successfully."
  50.   }
  51. }
  52. If there is an error, the response will be:
  53.  
  54. {
  55.   "status": "error",
  56.   "message": "Failed to send email. Invalid recipient address."
  57. }
  58. Documentation
  59. For further details and use cases, you can visit the official documentation of the Email Sender API at: https://letsextract.com/email-sender/
Advertisement
Add Comment
Please, Sign In to add comment