The 1NCE Connector enables you to easily integrate data from the 1NCE portal into your devices. Data usage is synchronized daily, and real-time events can be received from both data stream
and 1NCE OS
. The service can also be used to change labels on SIM cards and to send SMS messages to devices.
The 1NCE Connector creates a linkage to the 1NCE Portal to facilitate bi-directional API calls. It also defines a webhook secret that you can use when defining data streams in the 1NCE Portal to push events to the IoT Bridge.
This event fires when a SIM is synchronized by the IoT Bridge, it can occur manually or as part of the daily synchronization.
{
"dataUsage": {
"expiry_date": "2033-02-02 00:00:00",
"last_status_change_date": "2022-11-02 11:40:12",
"last_volume_added": 500,
"peak_throughput": 128000,
"threshold_percentage": 20,
"total_volume": 500,
"volume": 499.539617
},
"general": {
"activation_date": "2022-11-02T11:39:46.000+0000",
"current_quota": 500,
"current_quota_SMS": 250,
"iccid": "8988228066603270262",
"imei": "3520091118915105",
"imei_lock": false,
"imsi": "901405103270262",
"ip_address": "10.173.253.4",
"label": "M Lambert",
"msisdn": "882285103270262",
"quota_status": {
"description": "More than 20% available",
"id": 0
},
"quota_status_SMS": {
"description": "More than 20% available",
"id": 0
},
"status": "Enabled"
},
"queryTime": 1.7770154,
"reason": "manual",
"status": null
}
manual
or daily-sync
indicating the reason for the synchronization event.This event fires when a usage event is generated by the 1NCE portal. The data available in the usage records is defined by 1NCE and is available here: https://help.1nce.com/dev-hub/docs/data-streamer-usage-records
{
"cost": 1,
"currency": {
"code": "EUR",
"id": 1,
"symbol": "€"
},
"end_timestamp": "2023-03-07T14:55:43Z",
"endpoint": {
"balance": null,
"id": 14096487,
"imei": "3520091118915105",
"ip_address": "10.173.253.4",
"name": "8988228066603270262",
"tags": null
},
"id": 839610411991272,
"imsi": "901405103270262",
"imsi_id": 4589416,
"operator": {
"country": {
"id": 38,
"mcc": "302",
"name": "Canada"
},
"id": 603,
"mnc": "22",
"name": "TELUS"
},
"organisation": {
"id": 47186,
"name": "81030086"
},
"sim": {
"iccid": "8988228066603270262",
"id": 3855479,
"msisdn": "882285103270262",
"production_date": "2021-11-24T10:05:50Z"
},
"start_timestamp": "2023-03-07T14:55:43Z",
"tariff": {
"id": 1,
"name": "Tariff 1",
"ratezone": {
"id": 1,
"name": "Zone 1"
}
},
"traffic_type": {
"description": "SMS",
"id": 6
},
"volume": {
"rx": 1,
"total": 1,
"tx": 0
}
}
This event fires when event records are received by the IoT Bridge from the 1NCE portal. The format of these events is defined by 1NCE here: https://help.1nce.com/dev-hub/docs/data-streamer-event-records
{
"alert": false,
"description": "New location received from SGSN for IMSI='901405103270262', now attached to SGSN='1403408.04.mmecd1.mmegidac0.mme.epc.mnc610.mcc302.3gppnetwork.org', IP='0.0.0.0', RAT type='E_UTRAN'.",
"detail": {
"country": {
"country_code": "1",
"id": 38,
"iso_code": "ca",
"mcc": "302",
"name": "Canada"
},
"id": 600,
"mnc": [{
"id": 81,
"mnc": "610"
},
{
"id": 544,
"mnc": "61"
}
],
"name": "Bell",
"tapcode": [{
"id": 59,
"tapcode": "CANBM"
}]
},
"endpoint": {
"id": 14096487,
"imei": "3520091118915105",
"ip_address": "10.173.253.4",
"name": "8988228066603270262",
"tags": null
},
"event_severity": {
"description": "INFO",
"id": 0
},
"event_source": {
"description": "Network",
"id": 0
},
"event_type": {
"description": "Update GPRS location",
"id": 2
},
"id": 839596969312401,
"imsi": {
"id": 4589416,
"import_date": "2021-11-24T10:05:50Z",
"imsi": "901405103270262"
},
"organisation": {
"id": 47186,
"name": "81030086"
},
"sim": {
"iccid": "8988228066603270262",
"id": 3855479,
"msisdn": "882285103270262",
"production_date": "2021-11-24T10:05:50Z"
},
"timestamp": "2023-03-07T14:42:12.170Z",
"user": null
}
This event fires when a mobile-originated (MO) SMS is pushed to the IoT Bridge from the 1NCE Portal. The format of these events is defined by 1NCE here: https://help.1nce.com/dev-hub/docs/sms-forwarder-events
{
"dcs": 0,
"dest_address": "5615043452",
"endpoint": {
"id": 14096487,
"name": "8988228066603270262"
},
"id": 13656689,
"multi_part_info": {
"identifier": 13656689,
"partno": 1,
"total": 1
},
"organisation": {
"id": 47186
},
"payload": "+RESP:GTRTL,423134,352009111891516,,0,0,1,3.0,0.0,109,66.1,-75.635417,45.448960,20230307145542,302,220,2d83,358070A,00,,1,20230307145543,0014$",
"pid": 0,
"source_address": "882285103270262",
"submit_date": "2023-03-07 14:55:43"
}
This event fires when a mobile-terminated (MT) SMS delivery report is pushed to the IoT Bridge from the 1NCE Portal. The format of these events is defined by 1NCE here: https://help.1nce.com/dev-hub/docs/sms-forwarder-events
{
"id": 2819195,
"final_date": "2020-06-09 15:06:38",
"submit_date": "2020-06-09 15:06:34",
"organisation": {
"id": 4567
},
"endpoint": {
"name": "<iccid>",
"id": 8765432
},
"status": {
"id": 4,
"status": "DELIVERED"
}
}
This event fires when a message is pushed from 1NCE OS to the IoT Bridge. The format of these events are defined by 1NCE here:
{
"device": {
"iccid": "8988228066603270262",
"imsi": "901405103270262",
"ip": "10.173.253.4"
},
"id": "1-63f5112f-83389f8e20b9b64cabbcdfee",
"payload": {
"encoding": "base64",
"type": "STRING",
"value": "K1JFU1A6R1RJTkYsNDIzMTM0LDM1MjAwOTExMTg5MTUxNiwsNDEsODk4ODIyODA2NjYwMzI3MDI2MjcsMjMsNiwwLCxGRiwsLDMuODgsMCw1LDIsMCwwLDIwMjMwMjIxMTg0NTAxLDcyLCwsLCwyMDIzMDIyMTE4NDUwMywwMDIyJA=="
},
"enahncedPayload":"+RESP:GTINF,423134,352009111891516,,41,89882280666032702627,23,6,0,,FF,,,3.88,0,5,2,0,0,20230221184501,72,,,,,20230221184503,0022$",
"received": "1677005103385",
"source": "UDP",
"type": "TELEMETRY_DATA",
"version": "1.0.0"
}
Send an arbitrary API call to the 1NCE API.
// issue a request to get all events from a particular SIM
var reply = cdp_1nce.apiCall('1nce_conn', 'get', '/management-api/v1/sims/89xxxx01/events')
get
, post
, put
, or delete
./management-api/v1...
Configure a single SIM.
// configure a single SIM
cdp_1nce.simConfigure('1nce_conn', '89xxx01', { label: 'mylabel', imei_lock: false, status: 'Enabled'})
Enabled
or Disabled
to change the state of the SIM (optional).Send a mobile terminated SMS to a device.
// configure a single SIM
cdp_1nce.sendSms('1nce_conn', '89xxx01', 'hello device', {udh: null, dcs: 0, sourceAddress: '<number>', expiry: 86400})
Configure 1NCE OS webhook integrations automatically
// create a webhook integration
cdp_1nce.createWebhookIntegration('1nce_conn', {})
LIFECYCLE
, TELEMETRY_DATA
, and ERROR
, defaults to all three types.Delete an existing 1NCE OS webhook integration. The integration must have been created with createWebhookIntegration()
.
// create a webhook integration
cdp_1nce.deleteWebhookIntegration('1nce_conn')
The following events are considered billable: