get https://secure.fusebill.com/v1/customers//CustomerEmailPreferences
This function allows you to get the email preferences for a specific customer.
Path Parameters
Property | Type | Description |
---|---|---|
customerId | Integer | This is the the ID value which uniquely identifies this Customer record in the Fusebill system. This value is unique to each customer. |
Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{customerId}/CustomerEmailPreferences" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id Field Returned by Create/Update customer
int pathParameter = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/"+pathParameter+"/CustomerEmailPreferences");
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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 Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/customers/{id}/CustomerEmailPreferences', headers=headers)
print(r.content)
Response
{
"customerId": 648454,
"preferences": [
{
"enabled": null,
"accountDefault": false,
"emailType": "CreditCardExpiry",
"emailCategory": "PaymentsAndRefunds"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "CustomerActivation",
"emailCategory": "Customers"
},
{
"enabled": true,
"accountDefault": false,
"emailType": "CustomerCredentialCreate",
"emailCategory": "Customers"
},
{
"enabled": null,
"accountDefault": true,
"emailType": "CustomerCredentialPasswordReset",
"emailCategory": "Customers"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "CustomerSuspend",
"emailCategory": "Customers"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "DraftInvoice",
"emailCategory": "InvoicesAndStatements"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "InvoiceOverdue",
"emailCategory": "InvoicesAndStatements"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "InvoicePost",
"emailCategory": "InvoicesAndStatements"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "PaymentFailed",
"emailCategory": "PaymentsAndRefunds"
},
{
"enabled": true,
"accountDefault": false,
"emailType": "PaymentMethodUpdate",
"emailCategory": "PaymentsAndRefunds"
},
{
"enabled": true,
"accountDefault": false,
"emailType": "PaymentReceived",
"emailCategory": "PaymentsAndRefunds"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "PendingExpiryRenewalNotice",
"emailCategory": "Subscriptions"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "Refund",
"emailCategory": "PaymentsAndRefunds"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "StatementNotification",
"emailCategory": "InvoicesAndStatements"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "SubscriptionActivation",
"emailCategory": "Subscriptions"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "SubscriptionCancellation",
"emailCategory": "Subscriptions"
},
{
"enabled": null,
"accountDefault": false,
"emailType": "UpcomingBillingNotification",
"emailCategory": "InvoicesAndStatements"
}
]
}
{
"ErrorId": 0,
"HttpStatusCode": 404,
"Errors": [
{
"Key": "Api Error",
"Value": "Customer with id 1 not found."
}
]
}