# Start Receiving Subscriber Data

Receive subscriber information from SMS MO (Mobile Originated) messages and monitor full lifecycle subscription events, including activations, renewals, and deactivations

## Authentication

Find your API token for each account in Settings => Security on the [9bits Customer Dashboard](https://dashboard.9bits.net/).

The token is sent in the `Authorization` header of each endpoint preceded by `Bearer`. It's required for all requests made to the VAS API such as accessing reports.

### SMS MO

Every SMS MO received from subscriber will be routed to the partner. This example is written in Python.

{% code overflow="wrap" %}

```python
import requests

url = f"{{ client_url }}"

# Define the payload data in a Python dictionary
data = {
    "type": "sms"
    "telco": "mtn",
    "from": "2348020000000",
    "to": "48974",
    "message": "games28",
    "product_id": "103",
    "sent_date": "2024-01-02 23:50:37"
}

# Define headers with authorization and content type
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json"
}

# Send the POST request
response = requests.post(url, json=data, headers=headers)

# Check the response
if response.status_code == 200:
    print("Request was successful.")
    print(response.json())
else:
    print(f"Request failed with status code: {response.status_code}")
    print(response.text)



```

{% endcode %}

### Activation

Every activation sync data received from the MNO will be routed to the partner. This example is written in Python.

```python
import requests

url = f"{{ client_url }}"

# Define the payload data in a Python dictionary
data = {
    "type": "activation_notification"
    "telco": "mtn",
    "product_id": "103",
    "product_name": "games_daily",
    "phone": "2348020000000",
    "fee": 20000,
    "auto_renewal": false,
    "date": "2024-01-02 23:50:37"
}

# Define headers with authorization and content type
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json"
}

# Send the POST request
response = requests.post(url, json=data, headers=headers)

# Check the response
if response.status_code == 200:
    print("Request was successful.")
    print(response.json())
else:
    print(f"Request failed with status code: {response.status_code}")
    print(response.text)



```

### Renewal

Every renewal sync data received from the MNO will be routed to the partner. This example is written in Python.

```python
import requests

url = f"{{ client_url }}"

# Define the payload data in a Python dictionary
data = {
    "type": "renewal_notification"
    "telco": "mtn",
    "product_id": "103",
    "product_name": "games_daily",
    "phone": "2348020000000",
    "fee": 20000,
    "auto_renewal": true,
    "date": "2024-01-02 23:50:37"
}

# Define headers with authorization and content type
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json"
}

# Send the POST request
response = requests.post(url, json=data, headers=headers)

# Check the response
if response.status_code == 200:
    print("Request was successful.")
    print(response.json())
else:
    print(f"Request failed with status code: {response.status_code}")
    print(response.text)



```

### Deactivation

Every deactivation sync data received from the MNO will be routed to the partner. This example is written in Python.

```python
import requests

url = f"{{ client_url }}"

# Define the payload data in a Python dictionary
data = {
    "type": "deactivation_notification"
    "telco": "mtn",
    "product_id": "103",
    "product_name": "games_daily",
    "phone": "2348020000000",
    "auto_renewal": false,
    "date": "2024-01-02 23:50:37"
}

# Define headers with authorization and content type
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json"
}

# Send the POST request
response = requests.post(url, json=data, headers=headers)

# Check the response
if response.status_code == 200:
    print("Request was successful.")
    print(response.json())
else:
    print(f"Request failed with status code: {response.status_code}")
    print(response.text)



```

### SMS REST formats and conventions

### JSON

JSON (appplication/json) is the content type of both requests and responses unless otherwise specified.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.9bits.net/value-added-services/content-services/start-receiving-subscriber-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
