Generate segmentation for customers
1 min
POST
https://app.amberflo.io/pricing/segmentation
Body Parameters
- bodycom.amberflo.analysis.segmentation.CustomerSegmentationRequest.in
- meterApiNamesstring[]requiredDescription
- meterGroupInfosmap<string, payment.meters.GroupInfo.in[]>Description
- minSegmentRationumberDescription
- amountOfSegmentsinteger<int32>Description
- amountOfMonthsToConsiderinteger<int32>Description
Responses
200
- com.amberflo.analysis.segmentation.AccountCustomerSegments.out
- customerSegmentscom.amberflo.analysis.segmentation.AccountUsageClusterSegment.out[]Description
- meterUsageClusterSegmentscom.amberflo.analysis.segmentation.MeterUsageClusterSegment.out[]Description
- meterApiNamestringDescription
- groupInfopayment.meters.GroupInfo.outDescription
- gimap<string, string>
- usageBucketListcom.amberflo.analysis.segmentation.MeterUsageSegmentBucket.out[]Description
- usagenumberDescription
- amountOfCustomersnumberDescription
- monthlyCustomerTrendnumberDescription
- averageUsagenumberDescription
- customersInSegmentinteger<int32>Description
curl
curl --location 'https://app.amberflo.io/pricing/segmentation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"meterApiNames": [
""
],
"meterGroupInfos": "",
"minSegmentRatio": 0,
"amountOfSegments": 0,
"amountOfMonthsToConsider": 0
}'javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"meterApiNames": [
""
],
"meterGroupInfos": "",
"minSegmentRatio": 0,
"amountOfSegments": 0,
"amountOfMonthsToConsider": 0
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/pricing/segmentation", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/pricing/segmentation")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"meterApiNames": [
""
],
"meterGroupInfos": "",
"minSegmentRatio": 0,
"amountOfSegments": 0,
"amountOfMonthsToConsider": 0
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/pricing/segmentation"
payload = json.dumps({
"meterApiNames": [
""
],
"meterGroupInfos": "",
"minSegmentRatio": 0,
"amountOfSegments": 0,
"amountOfMonthsToConsider": 0
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successful request
{
"customerSegments": [
{
"meterUsageClusterSegments": [
{
"meterApiName": "",
"groupInfo": {
"gi": ""
},
"usageBucketList": [
{
"usage": 0,
"amountOfCustomers": 0,
"monthlyCustomerTrend": 0
}
],
"averageUsage": 0
}
],
"customersInSegment": ""
}
]
}