put https://secure.fusebill.com/v1/customernotes/
This function is used to create a new Customer note.
Request Parameters
Property | Type | Description | Required |
---|---|---|---|
customerid | Integer | This is the Fusebill generated customer ID | Yes |
note | String | The is the string of text you wish to store on a customer. [Max Length: 2000 characters] | Yes |
Examples
curl -X Put \
https://secure.fusebill.com/v1/CustomerNotes \
-H 'Authorization: Basic {APIKey}' \
-H 'Content-Type: application/json' \
-d '{
"note":"Sample",
"customerid":{CustomerId}
}'
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData = "{'customerId':{customerId},'note':'Test Note String'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerNotes");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(jsonData);
streamWriter.Flush();
streamWriter.Close();
}
//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 json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {'customerId': {id},"note":"Sample customer note"}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/customerNotes', data=json.dumps(payload), headers=headers)
print(r.content)
{
"customerId": 5678131,
"note": "This customer is hard of hearing, use email communications only"
}
Response
{
"userWhoCreatedNote": "API - User not specified",
"note": "hello world",
"createdTimestamp": "2019-11-07T19:03:13.0001383Z",
"id": 46600,
"uri": null
}
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "entity.Note",
"Value": "The note cannot exceed 2000 characters"
}
]
}