Skip to content

Commit db94a00

Browse files
muhammadatifjavmarkzegarelli
andauthored
add docs for amberflo integration (#2662)
* add docs for amberflo integration * edits Co-authored-by: markzegarelli <[email protected]>
1 parent fa18ce1 commit db94a00

File tree

3 files changed

+195
-0
lines changed

3 files changed

+195
-0
lines changed

.github/Vocab/Docs/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
(?:U|u)rls?\b
1414
Adwords
1515
allowlist
16+
Amberflo
1617
Appboy
1718
blocklist
1819
boolean
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
title: Amberflo Destination
3+
hidden: true
4+
id: 62274854b16140600b51d1cd
5+
---
6+
## Amberflo Destination
7+
8+
[Amberflo](https://www.amberflo.io/) provides cloud based usage metering, pricing, and billing. Meter any infrastructure, platform, application, custom resource, event, or feature. Amberflo provides an end-to-end usage platform engine that serves as the system of records and single source of truth. It's platform is built on top of the metering service, Amberflo Metering Cloud. It is built on cloud platform design principles of durability, availability, scalability, and cost-effectiveness with specialized logic built-in to ensure accuracy of the metering system - that is that each record is processed once, and once only, and that duplicate records sent are automatically de-duped. Amberflo Billing Cloud is a decoupled (yet integrated) application that is built on the Metering Cloud. It allows users to create, model, and manage usage-based pricing plans with full flexibility over modern sales artifacts such as prepaid credits, rewards, promotions, and custom currency creation.
9+
10+
This destination is maintained by Amberflo. For any issues with the destination, [contact the Amberflo Support team](mailto:[email protected]).
11+
12+
## Getting Started
13+
14+
{% include content/connection-modes.md %}
15+
16+
1. From the Destinations catalog page in the Segment App, click **Add Destination**.
17+
2. Search for "Amberflo" in the Destinations Catalog, and select the "Amberflo" destination.
18+
3. Choose which Source should send data to the "Amberflo" destination.
19+
4. Go to the [Amberflo dashboard](https://ui.amberflo.io/settings/account/api-keys), find and copy the "API key".
20+
5. Enter the "API Key" in the "Amberflo" destination settings in Segment.
21+
22+
## Supported methods
23+
24+
Amberflo supports the following methods, as specified in the [Segment Spec](/docs/connections/spec).
25+
26+
### Page
27+
28+
Send [Page](/docs/connections/spec/page) calls the [Amberflo Ingestion API](https://docs.amberflo.io/reference/post_ingest) to ingest as a meter with value 1. For example:
29+
```js
30+
analytics.page({
31+
userId: "some_user_id",
32+
name: "Home",
33+
properties: {
34+
"title": "Welcome | Initech",
35+
"keywords": "paper,comedy",
36+
"search": "schrute farms",
37+
"referrer": "https://google.com",
38+
"path": "/home",
39+
"browser": "Chrome",
40+
"url": "https://segment.com"
41+
}
42+
})
43+
```
44+
45+
Segment sends Page calls to Amberflo as a `page` meter.
46+
47+
```json
48+
curl --request POST \
49+
--url https://app.amberflo.io/ingest \
50+
--header 'Accept: application/json' \
51+
--header 'Content-Type: application/json' \
52+
--header 'x-api-key: YOUR_API_KEY' \
53+
--data '
54+
{
55+
"uniqueId": "messageId",
56+
"customerId": "some_user_id",
57+
"meterApiName": "page",
58+
"meterValue": 1.0,
59+
"meterTimeInMillis": 1619445706909,
60+
"title": "Welcome _ Initech",
61+
"keywords": "paper,comedy",
62+
"search": "schrute farms",
63+
"referrer": "https:__google.com",
64+
"path": "_home",
65+
"browser": "Chrome",
66+
"url": "https:__segment.com"
67+
}
68+
}
69+
'
70+
```
71+
72+
73+
### Screen
74+
75+
Send [Screen](/docs/connections/spec/screen) calls the [Amberflo Ingestion API](https://docs.amberflo.io/reference/post_ingest) to ingest as a meter with value 1. For example:
76+
77+
```js
78+
analytics.screen({
79+
userId: "some_user_id",
80+
name: "Home",
81+
properties: {
82+
"title": "Welcome | Initech"
83+
}
84+
})
85+
```
86+
87+
Segment sends Screen calls to Amberlfo as a `screen` meter.
88+
```json=
89+
curl --request POST \
90+
--url https://app.amberflo.io/ingest \
91+
--header 'Accept: application/json' \
92+
--header 'Content-Type: application/json' \
93+
--header 'x-api-key: YOUR_API_KEY' \
94+
--data '
95+
{
96+
"uniqueId": "messageId",
97+
"customerId": "some_user_id",
98+
"meterApiName": "screen",
99+
"meterValue": 1.0,
100+
"meterTimeInMillis": 1619445706909,
101+
"dimensions": {
102+
"name": "Home",
103+
"title": "Welcome _ Initech"
104+
}
105+
}
106+
'
107+
```
108+
109+
110+
### Identify
111+
112+
Send [Identify](/docs/connections/spec/identify) calls the [Amberflo Customers API](https://docs.amberflo.io/reference/post_customers) to create a customer in Amberflo or update if the customer already exists. For example:
113+
114+
```js
115+
analytics.identify({
116+
userId: "some_user_id",
117+
traits: {
118+
"name": "John Doe",
119+
"email": "[email protected]",
120+
"plan": "premium",
121+
"logins": 5,
122+
"phone": "650-769-3240",
123+
"username": "marakasina",
124+
"website": "example.com",
125+
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/scottkclark/128.jpg"
126+
}
127+
})
128+
```
129+
130+
Segment sends Identify calls to Amberflo as a `customer` record.
131+
132+
```json=
133+
curl --request PUT \
134+
--url https://app.amberflo.io/customers \
135+
--header 'Accept: application/json' \
136+
--header 'Content-Type: application/json' \
137+
--header 'x-api-key: YOUR_API_KEY' \
138+
--data '
139+
{
140+
"customerId": "some_user_id",
141+
"customerName": "John Doe",
142+
"customerEmail": "[email protected]",
143+
"traits": {
144+
"plan": "premium",
145+
"logins": 5,
146+
"phone": "650-769-3240",
147+
"username": "marakasina",
148+
"website": "example.com",
149+
"avatar": "https:__s3.amazonaws.com_uifaces_faces_twitter_scottkclark_128.jpg"
150+
}
151+
}
152+
'
153+
```
154+
155+
156+
### Track
157+
158+
Send [Track](/docs/connections/spec/track) calls [Amberflo Ingestion API](https://docs.amberflo.io/reference/post_ingest) to ingest as a meter with value of `properties.value` or 1 if value is not set. For example:
159+
160+
```js
161+
analytics.track({
162+
userId: "some_user_id",
163+
event: "ApiCalls",
164+
properties: {
165+
"value" : 2.0
166+
"region": "us-west-2"
167+
}
168+
})
169+
```
170+
171+
Segment sends Track calls to Amberflo as a meter ingestion record with `meterApiName=track.event`.
172+
173+
```json=
174+
curl --request POST \
175+
--url https://app.amberflo.io/ingest \
176+
--header 'Accept: application/json' \
177+
--header 'Content-Type: application/json' \
178+
--header 'x-api-key: YOUR_API_KEY' \
179+
--data '
180+
{
181+
"uniqueId": "messageId",
182+
"customerId": "some_user_id",
183+
"meterApiName": "ApiCalls",
184+
"meterValue": 2.0,
185+
"meterTimeInMillis": 1619445706909,
186+
"dimensions": {
187+
"region": "us-west-2"
188+
}
189+
}
190+
'
191+
```
192+
193+
---

vale-styles/Vocab/Docs/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
(?:U|u)rls?\b
1414
Adwords
1515
allowlist
16+
Amberflo
1617
Appboy
1718
blocklist
1819
boolean

0 commit comments

Comments
 (0)