|
| 1 | +--- |
| 2 | +title: Kable Destination |
| 3 | +id: 622786bfebadaf74178dfebe |
| 4 | +beta: true |
| 5 | +--- |
| 6 | + |
| 7 | +[Kable](https://kable.io/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank"} helps API companies launch and grow their business with easy-to-use billing infrastructure and analytics tools that work at any scale. |
| 8 | + |
| 9 | +The fastest-growing API companies trust Kable to automate their revenue operations, improve their developer experience, and empower their product leaders to iterate on pricing and packaging without limitations or bottlenecks. |
| 10 | + |
| 11 | +This Segment destination is maintained by Kable. For any questions or issues, please [contact Kable Support ](mailto:[email protected]). |
| 12 | + |
| 13 | +## Getting Started |
| 14 | + |
| 15 | +{% include content/connection-modes.md %} |
| 16 | + |
| 17 | +1. From the Segment web app, click **Catalog** then **Destinations**. |
| 18 | +2. Search for **Kable** in the Destinations Catalog, and select **Kable**. |
| 19 | +3. Click **Configure Kable**. |
| 20 | +4. Choose which Source(s) should send data to Kable, and add a name for your Kable Segment Destination. |
| 21 | +5. Configure your Segment Connection Settings: |
| 22 | + * Add your **Kable Client ID** and **Kable API Key**. (You can find your Kable Client ID and API Keys in the [Company tab](https://dashboard.kable.io/company){:target="_blank"} of your Kable dashboard.) |
| 23 | + * Specify which Segment event field corresponds to your customer's **Client ID** on Kable. |
| 24 | + * Map any other Segment event `properties` to Kable event fields. |
| 25 | + |
| 26 | + |
| 27 | +| Setting | Description | Example | |
| 28 | +| ------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | |
| 29 | +| API Key | Your Kable API Key | `sk_test.h6kVNO3I...` | |
| 30 | +| Kable Client ID | Your Kable Client ID | `kci_3c90e9ac92c6...` | |
| 31 | +| Client ID Field | The field from your Segment events that corresponds to your customer's `clientId` on Kable. | `userId` | |
| 32 | +| Properties Mappings | Map fields from Segment event `properties` to fields in Kable event `data`. Use dot notation to map nested fields. | `segmentX : kableX` `nested.field : dimension` | |
| 33 | + |
| 34 | + |
| 35 | +## Supported methods |
| 36 | + |
| 37 | +Kable supports Segment [Track](/docs/connections/spec/track) calls to capture usage metrics from your API. Learn more about Segment Track calls in the [Segment Spec](/docs/connections/spec). |
| 38 | + |
| 39 | + |
| 40 | +### Track |
| 41 | + |
| 42 | +Send [Track](/docs/connections/spec/track) calls to Segment to record [usage events](https://docs.kable.io/docs/usage-events){:target="_blank"} in Kable. For example: |
| 43 | + |
| 44 | +```js |
| 45 | +analytics.track({ |
| 46 | + event: "your_event_type", |
| 47 | + userId: "yourcompanyuser_1234567890", |
| 48 | + properties: { |
| 49 | + segmentX: "important data point", |
| 50 | + messageId: "msg_ABC123XYZ456", |
| 51 | + objectCount: 12, |
| 52 | + bankAccountBalance: 399.99, |
| 53 | + } |
| 54 | +}); |
| 55 | +``` |
| 56 | + |
| 57 | +The Segment Track event above would be transformed and transmitted to Kable as: |
| 58 | + |
| 59 | +```curl |
| 60 | +curl --request POST \ |
| 61 | + --url https://live.kable.io/api/v1/events/create \ |
| 62 | + --header 'Accept: application/json' \ |
| 63 | + --header 'Content-Type: application/json' \ |
| 64 | + --header 'Kable-Client-ID: <YOUR_KABLE_CLIENT_ID>' \ |
| 65 | + --header 'Kable-Client-Secret: <YOUR_KABLE_CLIENT_SECRET>' \ |
| 66 | + --data ' |
| 67 | +{ |
| 68 | + "clientId": "messageId", |
| 69 | + "timestamp": "2022-01-09T09:32:01Z", # Segment timestamp |
| 70 | + "transactionId": "022bb90c-bbac-11e4-8dfc-aa07a5b093db", # Segment messageId |
| 71 | + "data": { |
| 72 | + "kableX": "important data point", # notice the property mapping here from the example above |
| 73 | + "messageId": "msg_ABC123XYZ456", |
| 74 | + "objectCount": 12, |
| 75 | + "bankAccountBalance": 399.99 |
| 76 | + } |
| 77 | +} |
| 78 | +``` |
0 commit comments