post https://secure.fusebill.com/v1/Salesforce/Latch
This function is used to latch a customer entity to a particular Salesforce account ID.
Request Parameters
Property | Type | Description | Required |
---|---|---|---|
fusebillId | Integer | This is the the ID value which uniquely identifies this customer record in the Fusebill system. | Yes |
salesforceId | String | The Salesforce Account ID to be associated with this customer. | Yes |
forceLatch | Boolean | This dictates the expected behavior if the customer is already attached to a Salesforce account. If set to true and the customer is already associated to Salesforce ID the system will disassociate the previous Salesforce ID and attach the new ID. If set to false and there is an existing Salesforce ID associated will the customer the request will return an error. In either case, if the customer is not associated to a Salesforce ID the customer will latch to the account regardless. | Optional |
Examples
curl -X POST "https://secure.fusebill.com/v1/Salesforce/Latch" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}" \
-d "{fusebillId:{customerId},salesforceId:'{salesforceId}'}"
//Json Payload
string jsonData = "{fusebillId:{customerId},salesforceID:'{salesforceId}','forceLatch': true}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Salesforce/Latch/");
//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 = {"fusebillId":{id},"salesforceId":'0014100000JJ3wtAAD'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/Salesforce/Latch', data=json.dumps(payload), headers=headers)
print(r.content)
{
"fusebillId":12717595,
"salesforceId":"0014100000JJ3wt",
"forceLatch":true
}
Response
{
"firstName":"John",
"middleName":null,
"lastName":"Doe",
"companyName":"Stolen Bikes",
"suffix":null,
"primaryEmail":"[email protected]",
"primaryPhone":"613-555-5555",
"secondaryEmail":"[email protected]",
"secondaryPhone":null,
"title":"Mr",
"reference":"1337",
"status":"Active",
"customerAccountStatus":"Good",
"currency":"USD",
"customerReference":{
"reference1":null,
"reference2":null,
"reference3":null,
"salesTrackingCodes":[
],
"id":172677,
"uri":"/172677"
},
"customerAcquisition":{
"adContent":null,
"campaign":null,
"keyword":null,
"landingPage":null,
"medium":null,
"source":null,
"id":172677,
"uri":"/172677"
},
"monthlyRecurringRevenue":25.9800,
"netMonthlyRecurringRevenue":25.9800,
"salesforceId":"0014100000JJ3wt",
"salesforceAccountType":null,
"salesforceSynchStatus":"Enabled",
"netsuiteId":null,
"netsuiteCustomerType":"",
"portalUserName":null,
"parentId":null,
"quickBooksLatchType":null,
"quickBooksId":null,
"quickBooksSyncToken":null,
"id":172677,
"uri":"/172677"
}
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "Salesforce Account 1 does not exist."
}
]
}