Get Started
NSPS Preparation
Configure a Handler in the NSPS before creating a connector. The Handler is responsible for sending events to the connector server. Specify the following parameters during setup:
-
Event Types
The types of events your connector will receive. See more details in the Event Types section. -
Required Data
Additional data that NSPS will add to the event. See more details here. -
Service URL
The address of your connector where NSPS will send events.
For example,https://my-server.com/my-event. -
Bearer Token
For security, all requests from NSPS are signed with a token.
Your connector must verify this token in every request using the headerAuthorization: Bearer <YOUR_API_TOKEN>.
After configuring the Handler in NSPS, you are ready to proceed to creating your own connector.
NSPS Connector Creation
Before you start, we recommend reviewing the original repository:
In this section you will learn how to:
Dependencies
This project uses third-party libraries and services required for the connector to work:
Server Setup
First, create a server that listens on a specific port (for example, 3000) and add a basic /process-event route.
Important! Create a
.envfile in the project root and add the following variables:Replace
your_secret_tokenwith your own token that you specified in the NSPS Handler.
Token Verification
Next, implement the verification of Bearer token in the Authorization header to ensure security.
Event Processing
You can extract the required data from the event body (for example, eventType and billStatus). In the example below, this data is simply printed to the console. At this stage, you can implement your own business logic: send data to the ES, save it to a database, etc.
Testing
This section shows what a test request from NSPS looks like, what response the connector must return, and what will be displayed in the console.
1. Example message from NSPS
Testing can be performed without NSPS by simulating a typical NSPS request.
See more about the request structure here.
Example
curl -X POST http://localhost:8000/process-event \
-H "Authorization: Bearer your-api-token" \
-H "Content-Type: application/json" \
-d '{
"event_id": "3e84c79f-ab6f-4546-8e27-0b6ab866f1fb",
"data": {
"event_type": "SIM/Updated",
"variables": {
"i_env": 1,
"i_event": 999999,
"i_account": 1,
"curr_status": "used",
"prev_status": "active"
}
},
"pb_data": {
"account_info": {
"bill_status": "open",
"billing_model": "credit_account",
"blocked": false,
"i_account": 1,
"i_customer": 6392,
"i_product": 3774,
"id": "79123456789@msisdn",
"phone1": "",
"product_name": "wtl Pay as you go",
"time_zone_name": "Europe/Prague",
"assigned_addons": [
{
"addon_effective_from": "2025-05-16T12:59:46",
"addon_priority": 10,
"description": "",
"i_product": 3775,
"i_vd_plan": 1591,
"name": "wtl Youtube UHD"
}
],
"service_features": [
{
"name": "netaccess_policy",
"effective_flag_value": "Y",
"attributes": [
{
"name": "access_policy",
"effective_value": "179"
}
]
}
]
},
"sim_info": {
"i_sim_card": 3793,
"imsi": "001010000020349",
"msisdn": "79123456789",
"status": "active"
},
"access_policy_info": {
"i_access_policy": 179,
"name": "WTL integration test",
"attributes": [
{
"group_name": "lte.wtl",
"name": "cs_profile",
"value": "cs-pp-20250319"
},
{
"group_name": "lte.wtl",
"name": "eps_profile",
"value": "eps-pp-20250319"
}
]
}
},
"handler_id": "p1-nsps",
"created_at": "2025-03-12T16:47:30.443939+00:00",
"updated_at": "2025-03-12T16:47:36.585885+00:00",
"status": "received"
}'
This example simulates a standard NSPS request and verifies that the connector processes events correctly.
2. Connector response
Connector response upon successful request processing:
If the token is missing or invalid:
{
"message": "Authentication failed",
"error": "Invalid API token",
"type": "AUTHENTICATION_ERROR"
}
If the request body is invalid or required fields are missing:
3. What you will see in the console
See also the main documentation: NSPS connector