# Webhook DATA CDR

## Webhook CDR Integration Example

1\. Login into [Monogoto hub](https://hub.monogoto.io/).

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2F4gAOF1VEfpjtlLVdFv08%2Flogin.PNG?alt=media&#x26;token=3d1edf75-b36d-4397-9535-39979f669b27" alt=""><figcaption></figcaption></figure>

2\. Go to **Integrations** section.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FQ3Oz4eB3sR3Qhfi6uFpx%2Fnew_0.PNG?alt=media&#x26;token=9810aed8-ec77-4aeb-82ca-3c8f72417f37" alt=""><figcaption></figcaption></figure>

3\. From available integrations list please press on **Webhook** option.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FJPm9e7ZIWRBISM2FurS4%2Fnew_1.PNG?alt=media&#x26;token=ae5c4d0b-ef67-45e9-8482-b1c2e2556534" alt=""><figcaption></figcaption></figure>

4\. Next please press on the button **+Setup Webhook.**

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FwpFCXmOnVEoTB5GZfeks%2Fnew_2.PNG?alt=media&#x26;token=0900c985-7584-4f58-a3db-c36090937296" alt=""><figcaption></figcaption></figure>

5\. You should see a window open for **Webhook** configurations.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FNjuE66ExpLmLWByRXvTO%2Fnew_3.0.PNG?alt=media&#x26;token=81c1b066-7f4c-4467-a905-d52e7443361f" alt=""><figcaption></figcaption></figure>

6\. Find your webhook url you wish to push the events to. *In this example, we use* [*webhook.site*](https://webhook.site/)*.*

![](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FEGMfSu7dq4zWBg3goV63%2F3.PNG?alt=media\&token=59d28e40-5460-466f-b1a7-e69610b3d8c6)

7\. Go back into your Monogoto hub where you started the **Webhook** integration and paste your webhook address.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FhtVTl9omvBe2kjuxdLIF%2Fnew_3.1.PNG?alt=media&#x26;token=095ed789-2c09-4f54-a56b-5010f07617d7" alt=""><figcaption></figcaption></figure>

8\. Press on the drop list button **Select events to track** and select **Data CDRs**. You can check descriptions of Events in [**Integrations** section](https://docs.monogoto.io/hub/integrations/..#general-integration-options).

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FXwFlDSK4oKLixC5bSYMs%2FNew_Data1.png?alt=media&#x26;token=25323c39-df53-4b8f-9a1c-a183c78d6933" alt=""><figcaption></figcaption></figure>

9\. By default **Billing updates**, **Production updates** and **Daily reports** Events notifications are enabled, but if you want only to get **Data CDRs**, then please remove them from the list by pressing on **x** button near each unwanted notification.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FeTXycmWls9S2IfpYgXqo%2FNew_Data2.png?alt=media&#x26;token=dab7e7cc-de91-4432-a299-ae40c5ab8a24" alt=""><figcaption></figcaption></figure>

10\. If you want to can give this integration a description or you can leave the default description.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FDLG4YngYQG3holInPfL8%2FNew_Data3.png?alt=media&#x26;token=d7973cc6-6de4-48a2-a3fb-61db2a1dfdef" alt=""><figcaption></figcaption></figure>

11\. In order to save our integration, please press on button **Setup Webhook**

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FDZrigHZ45zdksfklLcem%2FNew_Data4.png?alt=media&#x26;token=e863ab32-5680-464c-ba79-f01aae067d84" alt=""><figcaption></figcaption></figure>

12\. You should now see your configured Monogoto hub integration with your **Webhook**.

<figure><img src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FKjdTvZtWVmK1tNkvyLWV%2FNew_Data5.png?alt=media&#x26;token=a0e604d2-b431-4e69-85d4-601ea10c2658" alt=""><figcaption></figcaption></figure>

## CDR Payload

Payload is the information contained in the CDR record, below you can see the information that the CDR may include. A common way to deliver CDR payloads is via the use of webhooks.

<table data-header-hidden><thead><tr><th width="199.83369022127056"></th><th width="150"></th><th width="341.0822726228293"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>CdrType</td><td>String</td><td>Type of service that was used:<br>DATA - mobile data</td></tr><tr><td>UniqueID</td><td>String</td><td>Unique identification of the Call Detail Record record</td></tr><tr><td>Iccid</td><td>String</td><td>SIM integrated circuit card identification number</td></tr><tr><td>IMSI</td><td>String</td><td>International mobile subscriber identity</td></tr><tr><td>MSISDN</td><td>String</td><td>Mobile mumber</td></tr><tr><td>IMEI</td><td>String</td><td>The IMEI number of the device using data</td></tr><tr><td>MNO</td><td>String</td><td>Mobile network operator identification number</td></tr><tr><td>MnoName</td><td>String</td><td>Mobile network operator name </td></tr><tr><td>MCC</td><td>String</td><td>Mobile country code</td></tr><tr><td>MNC</td><td>String</td><td>Mobile network code used to identify the operator</td></tr><tr><td>ThingName</td><td>String</td><td>SIM name in the Monogoto portal </td></tr><tr><td>ThingId</td><td>String</td><td>SIM identification number </td></tr><tr><td>ThingsGroupId</td><td>String</td><td>SIM Thing group identification number</td></tr><tr><td>ThingsGroupName</td><td>String</td><td>SIM Thing group name</td></tr><tr><td>Timestamp</td><td>Number</td><td>ISO 8601 DateTime, shown in UTC time. It may be converted to readable date/time using <a href="https://www.epochconverter.com/">3rd party tools</a></td></tr><tr><td>Usage</td><td>Number</td><td>Mobile data usage in bytes</td></tr><tr><td>APN</td><td>String</td><td>Used device APN (Access Point Name). Mandatory setting in device for the mobile data to work properly</td></tr></tbody></table>

## CDR Example

### Data Usage CDR

```json
[
  {
    "CdrType": "DATA",
    "UniqueID": "CDR-AYGGEWKNrXqt4AT20SP9",
    "Iccid": "8912372646888991",
    "IMSI": "123456789101112",
    "MSISDN": "+420412381231",
    "IMEI": "359110060403437",
    "MNO": "MNOId_c3273458-a996-44ac-a835-3a80fb8aeacf",
    "MnoName": "TELENET GROUP BVBA/SPRL",
    "MCC": "206",
    "MNC": "20",
    "ThingName": "ICCID 8912372646888991",
    "ThingId": "ThingId_ICCID_8912372646888991",
    "ThingsGroupId": "ThingsGroupId_acec2e16-6af3-4853-871f-9406b238504f",
    "ThingsGroupName": "Warehouse",
    "Timestamp": 1655811695222,
    "Usage": 7308,
    "APN": "data.mono"
  },
  {
    "CdrType": "DATA",
    "UniqueID": "CDR-AYGGEUU97hULQTWCmDzT",
    "Iccid": "8912372646888991",
    "IMSI": "123456789101112",
    "MSISDN": "+420412381232",
    "IMEI": "359110060403437",
    "MNO": "MNOId_c3273458-a996-44ac-a835-3a80fb8aeacf",
    "MnoName": "TELENET GROUP BVBA/SPRL",
    "MCC": "206",
    "MNC": "20",
    "ThingName": "ICCID 8912372646888991",
    "ThingId": "ThingId_ICCID_8912372646888991",
    "ThingsGroupId": "ThingsGroupId_acec2e16-6af3-4853-871f-9406b238504f",
    "ThingsGroupName": "Warehouse",
    "Timestamp": 1655811687717,
    "Usage": 7690,
    "APN": "data.mono"
  },
  {
    "CdrType": "DATA",
    "UniqueID": "CDR-AYGGEZiOrXqt4AT20SeB",
    "Iccid": "8912372646888991",
    "IMSI": "123456789101112",
    "MSISDN": "+420412381233",
    "IMEI": "359110060379868",
    "MNO": "MNOId_4a08c666-23de-4b9e-8114-a0a2f2ca3c74",
    "MnoName": "BOUYGUES TÉLÉCOM",
    "MCC": "208",
    "MNC": "20",
    "ThingName": "ICCID 8912372646888991",
    "ThingId": "ThingId_ICCID_8912372646888991",
    "ThingsGroupId": "ThingsGroupId_acec2e16-6af3-4853-871f-9406b238504f",
    "ThingsGroupName": "Warehouse",
    "Timestamp": 1655811709046,
    "Usage": 7948,
    "APN": "data.mono"
  },
  {
    "CdrType": "DATA",
    "UniqueID": "CDR-AYGGEUvhrXqt4AT20SL6",
    "Iccid": "8912372646888991",
    "IMSI": "123456789101112",
    "MSISDN": "+420412381234",
    "IMEI": "359110060388349",
    "MNO": "MNOId_054a1aef-26b2-4344-b194-519db9433701",
    "MnoName": "VODAFONE LIBERTEL B.V.",
    "MCC": "204",
    "MNC": "04",
    "ThingName": "ICCID 8912372646888991",
    "ThingId": "ThingId_ICCID_8912372646888991",
    "ThingsGroupId": "ThingsGroupId_acec2e16-6af3-4853-871f-9406b238504f",
    "ThingsGroupName": "Warehouse",
    "Timestamp": 1655811689418,
    "Usage": 6026,
    "APN": "data.mono"
  }
]
```
