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:
How to Use This Documentation
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.
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" } ]
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" } ]
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" } ]
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" }
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." }
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." }
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." }
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" } ]
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" } ]
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" } ]
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" }
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" } }
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 }
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 }
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." }
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." }
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." }
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." }
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." }
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." }
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." }
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" } ]
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." }
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." }
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 }
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" } ]
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" } ]
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" } ]
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." }
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 }
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" } ]
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." }
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." }
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." }
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." }
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." }
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 }
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 } ] }
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 }
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 }
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 }
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 }
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" } ]
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" }
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." }
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" } ]
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" }
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 }
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." }
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." }
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 }
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." }
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." }
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!
" } ]