NextMail User-Friendly API Documentation

Welcome to the API documentation for NextMail. This guide provides an easy-to-understand explanation of various API methods, their purposes, required inputs, outputs, and example use cases. Use this guide to integrate our API into your applications effortlessly.

NextMail API Documentation Overview
This comprehensive API documentation covers the following functional areas:

  1. Campaign Management
  2. Contact Management
  3. Mailing Management
  4. List Management
  5. Reporting
  6. Segment Management
  7. Template Management

How to Use This Documentation

  1. Authentication: All API endpoints require an API key parameter. Include your unique API key with each request.
  2. Interactive Interface: Each section is expandable - click on a category to see detailed endpoint information including:
  3. Request Format: The documentation provides clear examples of:
  4. Common Patterns: The API consistently uses:

This API is designed to be RESTful and straightforward to integrate, with consistent patterns across all endpoints. Each section provides complete examples that can be used as templates for your own implementations. The documentation is structured to help both beginners and experienced developers quickly find the information they need to successfully integrate the API into their applications.

Campaign Management

Get All Campaigns

Endpoint: /api/assigncampaign/GetAllCampaigns

Method: GET

Purpose: Retrieve a list of all campaigns available on the first page.

Inputs:

Outputs:

Example:

GET /api/assigncampaign/GetAllCampaigns?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "CampaignId": 123,
    "Name": "Winter Sale",
    "Status": "Active"
  },
  {
    "CampaignId": 124,
    "Name": "Spring Clearance",
    "Status": "Paused"
  }
]
    
Get Next All Campaigns

Endpoint: /api/assigncampaign/GetNextAllCampaigns

Method: GET

Purpose: Retrieve the next page of campaigns.

Inputs:

Outputs:

Example:

GET /api/assigncampaign/GetNextAllCampaigns?ApiKey=YOUR_API_KEY&NextPageToken=ABC123
    

Response:

[
  {
    "CampaignId": 125,
    "Name": "Fall Sale",
    "Status": "Active"
  }
]
    
Get Previous All Campaigns

Endpoint: /api/assigncampaign/GetPreviousAllCampaigns

Method: GET

Purpose: Retrieve the previous page of campaigns.

Inputs:

Outputs:

Example:

GET /api/assigncampaign/GetPreviousAllCampaigns?ApiKey=YOUR_API_KEY&PreviousPageToken=XYZ789
    

Response:

[
  {
    "CampaignId": 122,
    "Name": "Summer Clearance",
    "Status": "Paused"
  }
]
    
Get Campaign By Campaign ID

Endpoint: /api/assigncampaign/GetCampaignByCampaignID

Method: GET

Purpose: Retrieve details of a specific campaign by its ID.

Inputs:

Outputs:

Example:

GET /api/assigncampaign/GetCampaignByCampaignID?ApiKey=YOUR_API_KEY&CampaignID=123
    

Response:

{
  "CampaignId": 123,
  "Name": "Winter Sale",
  "Status": "Active"
}
    
Delete Campaign

Endpoint: /api/assigncampaign/DeleteCampaign

Method: DELETE

Purpose: Delete a campaign by its ID.

Inputs:

Outputs:

Example:

DELETE /api/assigncampaign/DeleteCampaign?ApiKey=YOUR_API_KEY&CampaignID=123
    

Response:

{
  "Success": true,
  "Message": "Campaign deleted successfully."
}
    
Job Board Unsubscribe

Endpoint: /api/jobboard/unsub

Method: POST

Purpose: Unsubscribe a user from job board updates.

Inputs:

Outputs:

Example:

POST /api/jobboard/unsub
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "Email": "user@example.com"
}
    

Response:

{
  "Success": true,
  "Message": "User unsubscribed successfully."
}
    
Send Mailing (4v)

Endpoint: /api/mailing/send4v

Method: POST

Purpose: Send a mailing with version 4 parameters.

Inputs:

Outputs:

Example:

POST /api/mailing/send4v
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "MailingDetails": {
    "Subject": "New Updates",
    "Body": "

Hello, check out our new updates!

", "Recipients": ["user1@example.com", "user2@example.com"] } }

Response:

{
  "Success": true,
  "Message": "Mailing sent successfully."
}
    

Contact Management

Get All Contacts

Endpoint: /api/contact/GetAllContacts

Method: GET

Purpose: Retrieve a list of all contacts.

Inputs:

Outputs:

Example:

GET /api/contact/GetAllContacts?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "ContactId": 456,
    "Name": "John Doe",
    "Email": "john.doe@example.com"
  },
  {
    "ContactId": 457,
    "Name": "Jane Smith",
    "Email": "jane.smith@example.com"
  }
]
    
Get Next Contacts

Endpoint: /api/contact/GetNextContacts

Method: GET

Purpose: Retrieve the next page of contacts.

Inputs:

Outputs:

Example:

GET /api/contact/GetNextContacts?ApiKey=YOUR_API_KEY&NextPageToken=ABC123
    

Response:

[
  {
    "ContactId": 458,
    "Name": "Alice Brown",
    "Email": "alice.brown@example.com"
  }
]
    
Get Previous Contacts

Endpoint: /api/contact/GetPrevContacts

Method: GET

Purpose: Retrieve the previous page of contacts.

Inputs:

Outputs:

Example:

GET /api/contact/GetPrevContacts?ApiKey=YOUR_API_KEY&PrevPageToken=XYZ789
    

Response:

[
  {
    "ContactId": 455,
    "Name": "Bob White",
    "Email": "bob.white@example.com"
  }
]
    
Get Contact

Endpoint: /api/contact/GetContact

Method: GET

Purpose: Retrieve details of a specific contact by ID.

Inputs:

Outputs:

Example:

GET /api/contact/GetContact?ApiKey=YOUR_API_KEY&ContactId=456
    

Response:

{
  "ContactId": 456,
  "Name": "John Doe",
  "Email": "john.doe@example.com"
}
    
Get Contact Details

Endpoint: /api/contact/GetContactDetails

Method: GET

Purpose: Retrieve detailed information about a contact by ID.

Inputs:

Outputs:

Example:

GET /api/contact/GetContactDetails?ApiKey=YOUR_API_KEY&ContactId=456
    

Response:

{
  "ContactId": 456,
  "Name": "John Doe",
  "Email": "john.doe@example.com",
  "CustomFields": {
    "Subscription": "Premium",
    "JoinDate": "2023-01-01"
  }
}
    
Add Single Contact

Endpoint: /api/contact/AddSingleContact

Method: POST

Purpose: Add a single contact to the system.

Inputs:

Outputs:

Example:

POST /api/contact/AddSingleContact
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ContactDetails": {
    "Name": "Jane Smith",
    "Email": "jane.smith@example.com"
  }
}
    

Response:

{
  "Success": true,
  "ContactId": 457
}
    
Add Recipient by All Fields

Endpoint: /api/contact/AddRecipientByAllFields

Method: POST

Purpose: Add a recipient with detailed field specifications.

Inputs:

Outputs:

Example:

POST /api/contact/AddRecipientByAllFields
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "RecipientDetails": {
    "Name": "Mark Johnson",
    "Email": "mark.johnson@example.com",
    "CustomFields": {
      "Subscription": "Premium"
    }
  }
}
    

Response:

{
  "Success": true,
  "RecipientId": 789
}
    
Add Custom Fields to Contact

Endpoint: /api/contact/AddCustomFieldsToContact

Method: POST

Purpose: Add custom fields to an existing contact.

Inputs:

Outputs:

Example:

POST /api/contact/AddCustomFieldsToContact
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ContactId": 457,
  "CustomFields": {
    "Subscription": "Gold",
    "LastPurchaseDate": "2023-10-01"
  }
}
    

Response:

{
  "Success": true,
  "Message": "Custom fields added successfully."
}
    
Edit Contact by All Fields

Endpoint: /api/contact/EditContactByAllFields

Method: PUT

Purpose: Update all fields of an existing contact.

Inputs:

Outputs:

Example:

PUT /api/contact/EditContactByAllFields
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ContactDetails": {
    "ContactId": 457,
    "Name": "Updated Jane Smith",
    "Email": "updated.jane.smith@example.com",
    "Phone": "123-456-7890"
  }
}
    

Response:

{
  "Success": true,
  "Message": "Contact updated successfully."
}
    
Edit Recipient by All Fields

Endpoint: /api/recipient/EditRecipientByAllFields

Method: PUT

Purpose: Update all fields of an existing recipient.

Inputs:

Outputs:

Example:

PUT /api/recipient/EditRecipientByAllFields
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "RecipientDetails": {
    "RecipientId": 789,
    "Name": "Updated Mark Johnson",
    "Email": "updated.mark.johnson@example.com",
    "CustomFields": {
      "Subscription": "Platinum"
    }
  }
}
    

Response:

{
  "Success": true,
  "Message": "Recipient updated successfully."
}
    
Edit Contact with Custom Fields by Email

Endpoint: /api/contact/EditContactWithCustomFieldsByEmail

Method: PUT

Purpose: Update a contact's custom fields using their email address.

Inputs:

Outputs:

Example:

PUT /api/contact/EditContactWithCustomFieldsByEmail
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "Email": "jane.smith@example.com",
  "CustomFields": {
    "Subscription": "Gold",
    "LastLogin": "2023-10-10"
  }
}
    

Response:

{
  "Success": true,
  "Message": "Custom fields updated successfully."
}
    
Edit Contact with Custom Fields by Contact ID

Endpoint: /api/contact/EditContactWithCustomFieldsByContactId

Method: PUT

Purpose: Update a contact's custom fields using their contact ID.

Inputs:

Outputs:

Example:

PUT /api/contact/EditContactWithCustomFieldsByContactId
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ContactId": 457,
  "CustomFields": {
    "LastPurchaseDate": "2023-11-01"
  }
}
    

Response:

{
  "Success": true,
  "Message": "Custom fields updated successfully."
}
    
Delete Recipient

Endpoint: /api/recipient/DeleteRecipient

Method: DELETE

Purpose: Delete a recipient by ID.

Inputs:

Outputs:

Example:

DELETE /api/recipient/DeleteRecipient?ApiKey=YOUR_API_KEY&RecipientId=789
    

Response:

{
  "Success": true,
  "Message": "Recipient deleted successfully."
}
    
Delete Contact

Endpoint: /api/contact/DeleteContact

Method: DELETE

Purpose: Delete a contact by ID.

Inputs:

Outputs:

Example:

DELETE /api/contact/DeleteContact?ApiKey=YOUR_API_KEY&ContactId=456
    

Response:

{
  "Success": true,
  "Message": "Contact deleted successfully."
}
    
Get All Subscribers from List

Endpoint: /api/list/GetAllSubscribersFromList

Method: GET

Purpose: Retrieve all subscribers from a specific list.

Inputs:

Outputs:

Example:

GET /api/list/GetAllSubscribersFromList?ApiKey=YOUR_API_KEY&ListId=123
    

Response:

[
  {
    "SubscriberId": 1,
    "Name": "John Doe",
    "Email": "john.doe@example.com"
  },
  {
    "SubscriberId": 2,
    "Name": "Jane Smith",
    "Email": "jane.smith@example.com"
  }
]
    
Unsubscribe Contact by Contact ID

Endpoint: /api/subscriber/UnsubscribeContactByContactId

Method: POST

Purpose: Unsubscribe a contact using their Contact ID.

Inputs:

Outputs:

Example:

POST /api/subscriber/UnsubscribeContactByContactId
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ContactId": 12345
}
    

Response:

{
  "Success": true,
  "Message": "Contact unsubscribed successfully."
}
    
Unsubscribe Contact by Email Address

Endpoint: /api/subscriber/UnsubscribeContactByEmailAddress

Method: POST

Purpose: Unsubscribe a contact using their email address.

Inputs:

Outputs:

Example:

POST /api/subscriber/UnsubscribeContactByEmailAddress
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "EmailAddress": "user@example.com"
}
    

Response:

{
  "Success": true,
  "Message": "Contact unsubscribed successfully."
}
    
Get Status by API Job ID

Endpoint: /api/job/GetStatusByApiJobId

Method: GET

Purpose: Retrieve the status of a job using its API job ID.

Inputs:

Outputs:

Example:

GET /api/job/GetStatusByApiJobId?ApiKey=YOUR_API_KEY&ApiJobId=ABC123
    

Response:

{
  "JobId": "ABC123",
  "Status": "Completed",
  "Processed": 100,
  "Failed": 0
}
    

List Management

Get All Lists

Endpoint: /api/list/GetAllLists

Method: GET

Purpose: Retrieve all available lists.

Inputs:

Outputs:

Example:

GET /api/list/GetAllLists?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "ListId": 1,
    "Name": "Newsletter Subscribers"
  },
  {
    "ListId": 2,
    "Name": "Event Attendees"
  }
]
    
Get Next Lists

Endpoint: /api/list/GetNextLists

Method: GET

Purpose: Retrieve the next page of lists.

Inputs:

Outputs:

Example:

GET /api/list/GetNextLists?ApiKey=YOUR_API_KEY&NextPageToken=ABC123
    

Response:

[
  {
    "ListId": 3,
    "Name": "New Campaign Subscribers"
  }
]
    
Get Previous Lists

Endpoint: /api/list/GetPreviousLists

Method: GET

Purpose: Retrieve the previous page of lists.

Inputs:

Outputs:

Example:

GET /api/list/GetPreviousLists?ApiKey=YOUR_API_KEY&PrevPageToken=XYZ789
    

Response:

[
  {
    "ListId": 1,
    "Name": "Newsletter Subscribers"
  }
]
    
Get List by List ID

Endpoint: /api/list/GetListByListId

Method: GET

Purpose: Retrieve details of a specific list by its ID.

Inputs:

Outputs:

Example:

GET /api/list/GetListByListId?ApiKey=YOUR_API_KEY&ListId=123
    

Response:

{
  "ListId": 123,
  "Name": "Newsletter Subscribers",
  "Description": "Subscribers to the monthly newsletter."
}
    
Add List

Endpoint: /api/list/AddList

Method: POST

Purpose: Create a new list.

Inputs:

Outputs:

Example:

POST /api/list/AddList
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "ListName": "Special Offers Subscribers"
}
    

Response:

{
  "Success": true,
  "ListId": 4
}
    

Mailing Management

Get All Mailings

Endpoint: /api/mailing/GetAllMailings

Method: GET

Purpose: Retrieve a list of all mailings.

Inputs:

Outputs:

Example:

GET /api/mailing/GetAllMailings?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "MailingId": 1,
    "Name": "Weekly Update",
    "Status": "Sent"
  },
  {
    "MailingId": 2,
    "Name": "Monthly Newsletter",
    "Status": "Scheduled"
  }
]
    
Launch Mailing

Endpoint: /api/mailing/LaunchMailing

Method: POST

Purpose: Launch a mailing to its intended recipients.

Inputs:

Outputs:

Example:

POST /api/mailing/LaunchMailing
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "MailingId": 123
}
    

Response:

{
  "Success": true,
  "Message": "Mailing launched successfully."
}
    
Send Transactional Email

Endpoint: /api/mailing/SendTransactionalEmail

Method: POST

Purpose: Send a transactional email to a specific recipient.

Inputs:

Outputs:

Example:

POST /api/mailing/SendTransactionalEmail
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "EmailDetails": {
    "Recipient": "user@example.com",
    "Subject": "Welcome!",
    "Body": "Hello, welcome to our platform!"
  }
}
    

Response:

{
  "Success": true,
  "Message": "Transactional email sent successfully."
}
    
Edit Mailing

Endpoint: /api/mailing/EditMailing

Method: PUT

Purpose: Edit the details of an existing mailing.

Inputs:

Outputs:

Example:

PUT /api/mailing/EditMailing
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "MailingDetails": {
    "MailingId": 123,
    "Name": "Updated Weekly Update",
    "Content": "

New content for the weekly update.

" } }

Response:

{
  "Success": true,
  "Message": "Mailing edited successfully."
}
    
Send Test Mail

Endpoint: /api/mailing/SendTestMail

Method: POST

Purpose: Send a test email to verify mailing details.

Inputs:

Outputs:

Example:

POST /api/mailing/SendTestMail
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "MailingId": 123,
  "TestRecipient": "test@example.com"
}
    

Response:

{
  "Success": true,
  "Message": "Test email sent successfully."
}
    
Delete Mailing

Endpoint: /api/mailing/DeleteMailing

Method: DELETE

Purpose: Delete an existing mailing by ID.

Inputs:

Outputs:

Example:

DELETE /api/mailing/DeleteMailing?ApiKey=YOUR_API_KEY&MailingId=123
    

Response:

{
  "Success": true,
  "Message": "Mailing deleted successfully."
}
    

Reporting

Get Aggregate Report by Date Range

Endpoint: /api/report/GetAggregateReportByDateRange

Method: GET

Purpose: Retrieve aggregate reports for a specified date range.

Inputs:

Outputs:

Example:

GET /api/report/GetAggregateReportByDateRange?ApiKey=YOUR_API_KEY&StartDate=2023-01-01&EndDate=2023-01-31
    

Response:

{
  "TotalEmailsSent": 1000,
  "TotalOpens": 800,
  "TotalClicks": 200
}
    
Get Next Aggregate Report by Date Range

Endpoint: /api/report/GetNextAggregateReportByDateRange

Method: GET

Purpose: Retrieve the next set of aggregate reports for a specified date range.

Inputs:

Outputs:

Example:

GET /api/report/GetNextAggregateReportByDateRange?ApiKey=YOUR_API_KEY&NextPageToken=ABC123
    

Response:

{
  "Reports": [
    { "Date": "2023-01-02", "EmailsSent": 100, "Opens": 80, "Clicks": 20 },
    { "Date": "2023-01-03", "EmailsSent": 150, "Opens": 120, "Clicks": 30 }
  ]
}
    
Get Open Report by Date Range

Endpoint: /api/report/GetOpenReportByDateRange

Method: GET

Purpose: Retrieve open reports for a specified date range.

Inputs:

Outputs:

Example:

GET /api/report/GetOpenReportByDateRange?ApiKey=YOUR_API_KEY&StartDate=2023-01-01&EndDate=2023-01-31
    

Response:

{
  "TotalOpens": 800,
  "UniqueOpens": 700
}
    
Get Click Report by Date Range

Endpoint: /api/report/GetClickReportByDateRange

Method: GET

Purpose: Retrieve click reports for a specified date range.

Inputs:

Outputs:

Example:

GET /api/report/GetClickReportByDateRange?ApiKey=YOUR_API_KEY&StartDate=2023-01-01&EndDate=2023-01-31
    

Response:

{
  "TotalClicks": 200,
  "UniqueClicks": 180
}
    
Get Bounce Report by Date Range

Endpoint: /api/report/GetBounceReportByDateRange

Method: GET

Purpose: Retrieve bounce reports for a specified date range.

Inputs:

Outputs:

Example:

GET /api/report/GetBounceReportByDateRange?ApiKey=YOUR_API_KEY&StartDate=2023-01-01&EndDate=2023-01-31
    

Response:

{
  "TotalBounces": 50,
  "HardBounces": 30,
  "SoftBounces": 20
}
    
Get Open Report by Mailing ID

Endpoint: /api/report/GetOpenReportByMailingId

Method: GET

Purpose: Retrieve open report details for a specific mailing ID.

Inputs:

Outputs:

Example:

GET /api/report/GetOpenReportByMailingId?ApiKey=YOUR_API_KEY&MailingId=123
    

Response:

{
  "TotalOpens": 500,
  "UniqueOpens": 450
}
    

Segment Management

Get All Segments

Endpoint: /api/segment/GetAllSegments

Method: GET

Purpose: Retrieve all segments.

Inputs:

Outputs:

Example:

GET /api/segment/GetAllSegments?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "SegmentId": 1,
    "Name": "Active Users"
  },
  {
    "SegmentId": 2,
    "Name": "Inactive Users"
  }
]
    
Get Segment by ID

Endpoint: /api/segment/GetSegmentById

Method: GET

Purpose: Retrieve a specific segment by its ID.

Inputs:

Outputs:

Example:

GET /api/segment/GetSegmentById?ApiKey=YOUR_API_KEY&SegmentId=1
    

Response:

{
  "SegmentId": 1,
  "Name": "Active Users",
  "Criteria": "LastLogin > 30 days"
}
    
Delete Segment by ID

Endpoint: /api/segment/DeleteSegmentById

Method: DELETE

Purpose: Delete a specific segment by its ID.

Inputs:

Outputs:

Example:

DELETE /api/segment/DeleteSegmentById?ApiKey=YOUR_API_KEY&SegmentId=1
    

Response:

{
  "Success": true,
  "Message": "Segment deleted successfully."
}
    
Get All Snapshots

Endpoint: /api/snapshot/GetAllSnapshots

Method: GET

Purpose: Retrieve all snapshots.

Inputs:

Outputs:

Example:

GET /api/snapshot/GetAllSnapshots?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "SnapshotId": 1,
    "Name": "Monthly Summary"
  },
  {
    "SnapshotId": 2,
    "Name": "Weekly Activity"
  }
]
    
Get Snapshot by ID

Endpoint: /api/snapshot/GetSnapshotById

Method: GET

Purpose: Retrieve a specific snapshot by its ID.

Inputs:

Outputs:

Example:

GET /api/snapshot/GetSnapshotById?ApiKey=YOUR_API_KEY&SnapshotId=1
    

Response:

{
  "SnapshotId": 1,
  "Name": "Monthly Summary",
  "Details": "Data from 01/01/2023 to 01/31/2023"
}
    
Add Snapshot

Endpoint: /api/snapshot/AddSnapshot

Method: POST

Purpose: Create a new snapshot.

Inputs:

Outputs:

Example:

POST /api/snapshot/AddSnapshot
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "Name": "Quarterly Analysis",
  "Details": "Data from Q1 2023"
}
    

Response:

{
  "Success": true,
  "SnapshotId": 3
}
    
Edit Snapshot

Endpoint: /api/snapshot/EditSnapshot

Method: PUT

Purpose: Edit an existing snapshot.

Inputs:

Outputs:

Example:

PUT /api/snapshot/EditSnapshot
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "SnapshotId": 1,
  "Name": "Updated Monthly Summary",
  "Details": "Updated data from 01/01/2023 to 01/31/2023"
}
    

Response:

{
  "Success": true,
  "Message": "Snapshot updated successfully."
}
    
Delete Snapshot

Endpoint: /api/snapshot/DeleteSnapshot

Method: DELETE

Purpose: Delete an existing snapshot.

Inputs:

Outputs:

Example:

DELETE /api/snapshot/DeleteSnapshot?ApiKey=YOUR_API_KEY&SnapshotId=1
    

Response:

{
  "Success": true,
  "Message": "Snapshot deleted successfully."
}
    

Template Management

Add Template

Endpoint: /api/template/AddTemplate

Method: POST

Purpose: Add a new template.

Inputs:

Outputs:

Example:

POST /api/template/AddTemplate
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "TemplateName": "Welcome Email",
  "TemplateContent": "

Welcome to our platform!

" }

Response:

{
  "Success": true,
  "TemplateId": 123
}
    
Edit Template

Endpoint: /api/template/EditTemplate

Method: PUT

Purpose: Edit an existing template.

Inputs:

Outputs:

Example:

PUT /api/template/EditTemplate
Content-Type: application/json

{
  "ApiKey": "YOUR_API_KEY",
  "TemplateId": 123,
  "TemplateName": "Updated Welcome Email",
  "TemplateContent": "

Welcome to our updated platform!

" }

Response:

{
  "Success": true,
  "Message": "Template updated successfully."
}
    
Delete Template

Endpoint: /api/template/DeleteTemplate

Method: DELETE

Purpose: Delete a template by its ID.

Inputs:

Outputs:

Example:

DELETE /api/template/DeleteTemplate?ApiKey=YOUR_API_KEY&TemplateId=123
    

Response:

{
  "Success": true,
  "Message": "Template deleted successfully."
}
    
Get All Templates

Endpoint: /api/template/GetAllTemplates

Method: GET

Purpose: Retrieve all templates.

Inputs:

Outputs:

Example:

GET /api/template/GetAllTemplates?ApiKey=YOUR_API_KEY
    

Response:

[
  {
    "TemplateId": 1,
    "TemplateName": "Welcome Email",
    "TemplateContent": "

Welcome to our platform!

" }, { "TemplateId": 2, "TemplateName": "Thank You Email", "TemplateContent": "

Thank you for your support!

" } ]