post https://secure.fusebill.com/v1/HubSpot/latchCustomer
This function is used to latch a customer entity to a particular HubSpot contact visitor ID (vid) and company ID. Only one Fusebill customer can be associated to a contact vid. Only one Fusebill customer can be associated to a company ID. This is for the Fusebill HubSpot integration.
Request Parameters
Property | Type | Description | Required |
---|---|---|---|
fusebillId | Number | This is the the ID value which uniquely identifies this customer record in the Fusebill system. | Yes |
hubSpotId | Number | This is the visitor ID (vid) of the contact in HubSpot you wish to associate the customer with. Use null to remove this mapping | Optional. Null by default. |
hubSpotCompanyId | Number | This is the companyId for the company in HubSpot you wish to associate the customer with. Use null to remove this mapping | Optional. Null by default. |
Examples
curl -X POST "https://secure.fusebill.com/v1/HubSpot/latchCustomer" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}" \
-d "{fusebillId:123456789,hubSpotId:101,hubSpotCompanyId:202}"
//Json Payload
string jsonData = "{fusebillId:1234567,hubSpotId:101,hubSpotCompanyId: 202}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/HubSpot/latchCustomer");
//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":123456,"hubSpotId":101, "hubSpotCompanyId":202}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/HubSpot/latchCustomer', data=json.dumps(payload), headers=headers)
print(r.content)
{
"fusebillid": 1234567,
"hubSpotId": 101,
"hubSpotCompanyId": 202
}
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":"/customers/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,
"hubSpotId": 101,
"hubSpotCompanyId": 202,
"modifiedTimestamp": "2020-04-28T14:12:00.0301255Z",
"id": 2554529,
"uri": "/customers/2554529"
}
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "The was an error getting the contact from HubSpot: resource not found"
}
]
}