get https://secure.fusebill.com/v1/CustomerEmailLogs
This function is used to retrieve a list of all emails sent to customers from your account.
To manage the size of the data returned, it is strongly recommended that pagination is used.
URL Parameters
Parameter name | Acceptable Type |
---|---|
customerID | Integer |
emailType | CustomerActivation, SubscriptionCancellation, CustomerCredentialCreate, CustomerSuspend, DraftInvoice, InvoiceOverdue, InvoicePost, StatementNotification, UpcomingBillingNotification, CreditCardExpiry, PaymentFailed, PaymentMethodUpdate, PaymentReceived, Refund, CreditAddedtoccount, PendingExpiryRenewalNotice, SubscriptionActivationCustomer, CredentialPasswordReset, CredentialPasswordSetup |
startDate | Date Range |
endDate | Date Range |
createdTimestamp | Date Range |
effectiveTimestamp | Date Range |
processedTimestamp | Date Range |
openedTimestamp | Date Range |
deliveryTimestamp | Date Range |
deliveryResult | String |
companyName | String |
toEmail | String |
Status | NotSent, Processed, Dropped, Deferred, Bounce, Delivered, Open, Other |
This call supports string filtering (Read More) and datetime/numeric range filtering (Read More)
&query=parameterName:Value
* See here for Fusebill currency codes
This call supports pagination (Read More)
&pageSize=10&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending
or &sortOrder=Descending
&sortExpression=expression
Examples
curl -X GET "https://secure.fusebill.com/v1/CustomerEmailLogs&pageSize=100&pageNumber=0" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/purchases/getbyProductId?id={{productID}}&query=Quantity:0|5&pageSize=100&pageNumber=0");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "GET";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
#Import library JSON
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI, Payload and Headers
r = requests.get('https://secure.fusebill.com/v1/purchases/getbyProductId?id={{productID}}&query=Quantity:0|5&pageSize=100&pageNumber=0', headers=headers)
print(r.content)
Response
[
{
"customerId": 250581,
"customerReference": "Steve",
"companyName": "Company Co.",
"customerFirstName": "Steve",
"customerLastName": "Smith",
"toEmail": "[email protected]",
"toDisplayName": "Mr Steve Smith",
"fromEmail": "[email protected]",
"fromDisplayName": "Billing Co.",
"bccEmail": "",
"subject": "Invoice from Billing Co.",
"body": "<p>Dear Steve Smith,</p>\n<p>The attached invoice number 854 for $36.16 CAD is due. </p>\n<p>Please remit payment by the due date.</p>\n<p>Please reference 250581 should you need to contact us.</p>\n<p>Thank you for your cooperation, we appreciate your business.</p>",
"effectiveTimestamp": "2022-10-04T05:42:57",
"deliveredTimestamp": "2022-10-04T05:43:00",
"processedTimestamp": "2022-10-04T05:42:57",
"openedTimestamp": "2022-10-04T05:43:04",
"lastUpdatedTimestamp": "2022-10-04T05:43:04",
"status": "Sent",
"result": "The message was successfully sent.",
"reason": "",
"sendgridEmailId": "526d3397-0d26-460b-a496-cc6655ed32ba",
"fromEmails": null,
"attachments": [
{
"customerEmailLogId": 13803573,
"attachmentName": "Invoice_854.pdf",
"id": 7351952,
"uri": null
}
],
"sendgridEvent": null,
"mostRecentSendgridEvent": null,
"createdTimestamp": "2022-10-04T05:42:55",
"deliveryResult": "open",
"id": 13803573,
"uri": null
},
{
"customerId": 10695514,
"customerReference": "",
"companyName": "",
"customerFirstName": "Joe",
"customerLastName": "Smith",
"toEmail": "[email protected]",
"toDisplayName": "Joe Smith",
"fromEmail": "[email protected]",
"fromDisplayName": " Billing Co.",
"bccEmail": "",
"subject": "Invoice from Billing Co.",
"body": "<p>Dear Joe Smith,</p>\n<p>The attached invoice number 853 for $135.54 USD is due. </p>\n<p>Please remit payment by the due date.</p>\n<p>Please reference 10695514 should you need to contact us.</p>\n<p>Thank you for your cooperation, we appreciate your business.</p>",
"effectiveTimestamp": "2022-10-02T05:14:37",
"deliveredTimestamp": null,
"processedTimestamp": null,
"openedTimestamp": null,
"lastUpdatedTimestamp": "2022-10-02T05:14:37",
"status": "Sent",
"result": "The message was successfully sent.",
"reason": "Bounced Address",
"sendgridEmailId": "b1c2b259-f2a1-4666-ab84-e9b5d93caad7",
"fromEmails": null,
"attachments": [
{
"customerEmailLogId": 13785010,
"attachmentName": "Invoice_853.pdf",
"id": 7338663,
"uri": null
}
],
"sendgridEvent": null,
"mostRecentSendgridEvent": null,
"createdTimestamp": "2022-10-02T05:14:35",
"deliveryResult": "dropped",
"id": 13785010,
"uri": null
},
{
"customerId": 10695514,
"customerReference": "",
"companyName": "",
"customerFirstName": "Joe",
"customerLastName": "Smith",
"toEmail": "[email protected]",
"toDisplayName": "Joe Smith",
"fromEmail": "[email protected]",
"fromDisplayName": "Billing Co.",
"bccEmail": "",
"subject": "Invoice from Billing Co.",
"body": "<p>Dear Joe Smith,</p>\n<p>The attached invoice number 853 for $135.54 USD is due. </p>\n<p>Please remit payment by the due date.</p>\n<p>Please reference 10695514 should you need to contact us.</p>\n<p>Thank you for your cooperation, we appreciate your business.</p> ",
"effectiveTimestamp": "2022-10-02T05:14:37",
"deliveredTimestamp": "2022-10-02T05:14:39",
"processedTimestamp": "2022-10-02T05:14:37",
"openedTimestamp": "2022-10-02T05:14:42",
"lastUpdatedTimestamp": "2022-10-02T05:14:42",
"status": "Sent",
"result": "The message was successfully sent.",
"reason": "",
"sendgridEmailId": "b1c2b259-f2a1-4666-ab84-e9b5d93caad7",
"fromEmails": null,
"attachments": [
{
"customerEmailLogId": 13785010,
"attachmentName": "Invoice_853.pdf",
"id": 7338663,
"uri": null
}
],
"sendgridEvent": null,
"mostRecentSendgridEvent": null,
"createdTimestamp": "2022-10-02T05:14:35",
"deliveryResult": "open",
"id": 13785010,
"uri": null
}
]
{
"ErrorId": 0,
"HttpStatusCode": 404,
"Errors": [
{
"Key": "Api Error",
"Value": "Product with id 1 not found."
}
]
}