API Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

BOSS API Manual

May 2020

Version 1.8
About This Document
This document is intended for software developers writing code to work with the Baicells Business &
Operations Support System (BOSS) using Application Programming Interface (API). BOSS is a CloudCore
application for managing broadband wireless access subscribers. Some sections of this document
pertain only to Local (private network) OMC+BOSS environments, depending on the software version,
and are noted as such. This version of the manual is based on BOSS version 6.0.

Copyright Notice
Baicells Technologies, Inc., copyrights the information in this document. No part of this document may
be reproduced in any form or means without the prior written consent of Baicells Technologies, Inc.
The Baicells logo is a proprietary trademark of Baicells Technologies, Inc. Other trademarks mentioned
in this document belong to their owners.

Disclaimer
All products, services, and features bought from Baicells Technologies, Inc., are subject to the
constraints of the company's business contract and terms. All or part of the products, services, or
features Descriptiond in this document might not be your specific Baicells network. Unless stated in
the contract, Baicells Technologies, Inc., does not make any explicit or default statement or guarantee
about the contents of this document.
Unless stated otherwise, this document serves only as a user guide, and all descriptions /
information / suggestions mean no guarantee, neither explicit nor implicit.
The information in this document is subject to change at any time without notice. For more
information, please consult with a Baicells technical engineer or the support team. Refer to the
“Contact Us” section.

Revision Record
Date Version Description SMEs/Contributors Editor
14-May-2020 V1.8 Updated for v6.0 Yunfeng Jiang Sharon Redfoot
2-Mar-2020 V1.7 New logo & colors Chris Culver Sharon Redfoot
25-Apr-2019 V1.6 Notated local BOSS Jesse Raasch Sharon Redfoot
environment sections
20-Mar-2019 V1.5 Preliminary - updated for China ZhangGuihua Sharon Redfoot
V1.4 V5 BaiBOSS doc Jesse Raasch
11-Dec-2017 V1.3 Checked UE, eNB terms Bob Stone Sharon Redfoot
16-Nov-2017 V1.2 Added N.A. URL Cameron Kilton Sharon Redfoot
5-Oct-2017 V1.1 Edit for North American Jesse Raasch, Rick Sharon Redfoot
customers and partners Harnish, Cameron
Kilton
Sept 2017 V1.0 New Simon, Yang Yanan

ii
Support Resources
• Documentation - Baicells product data sheets, this document, and other technical
manuals may be found at Baicells > Resources > Documentation.
• Support - How to open a support ticket, process an RMA, and the Support Forum are at
Baicells > Support.

Contact Us
Baicells Technologies Co., Ltd. Baicells Technologies North America, Inc.

China North America

Address: 3F, Bldg. A, No. 1 Kai Tuo Rd, Haidian Dist, Address: 555 Republic Dr., #200, Plano, TX 75074,
Beijing, China USA

Phone: +86-10-62607100 Phone: +1-888-502-5585

Email: [email protected] or
E-mail: [email protected]
[email protected]

Website: www.Baicells.com Website: https://na.Baicells.com

iii
Table of Contents
1. API OVERVIEW......................................................................................................................................... 1

2. API LIST.................................................................................................................................................... 3

2.1 SUBSCRIBER CATEGORY ............................................................................................................................... 3

2.1.1 Query Subscriber........................................................................................................................... 3

2.1.2 Create Subscriber .......................................................................................................................... 5

2.1.3 Bind Service Plan .......................................................................................................................... 6

2.1.4 Bind IMSI ............................................................................................................................................... 8

2.1.5 Unbind IMSI........................................................................................................................................... 9

2.1.6 Activate Subscriber .............................................................................................................................. 11

2.1.7 Deactivate Subscriber.......................................................................................................................... 12

2.1.8 Change Service Plan ............................................................................................................................ 13

2.1.9 Change Speed (Uplink and Downlink) ................................................................................................. 15

2.1.10 Bulk Activate Subscribers .................................................................................................................. 16

2.1.11 Bulk Deactivate Subscribers .............................................................................................................. 18

2.1.12 Query Subscriber by sub_id ............................................................................................................... 20

2.1.13 Bind APN and Static IP ...................................................................................................................... 21

2.1.14 Remove APN and Static IP ................................................................................................................. 24

2.1.15 Modify Subscriber ............................................................................................................................. 25

2.1.16 Delete Subscriber .............................................................................................................................. 27

2.1.17 Bulk Create Subscriber ...................................................................................................................... 28

2.1.18 Subscriber Redirection....................................................................................................................... 32

2.1.19 Subscriber Cancel Redirection ........................................................................................................... 33

2.1.20 Query Subscriber by IP ...................................................................................................................... 34

2.1.21 Activate Subscriber by IMSI ............................................................................................................... 36

2.1.22 Deactivate Subscriber by IMSI ........................................................................................................... 37

2.1.23 Subscriber Redirection by IMSI .......................................................................................................... 39

2.1.24 Subscriber Cancel Redirection by IMSI .............................................................................................. 40

2.1.25 Change Speed by IMSI (Uplink and Downlink) .................................................................................. 42

2.1.26 Query Subscriber by IMSI .................................................................................................................. 43

2.1.27 Change Service Plan by IMSI ............................................................................................................. 45

2.1.28 Modify Subscriber by IMSI................................................................................................................. 46

2.1.29 Delete Subscriber by IMSI .................................................................................................................. 48

iv
2.2 SERVICE PLAN (PACKAGE/PROFILE) CATEGORY............................................................................................... 50

2.2.1 Create Service Plan (Package/Profile) ................................................................................................. 50

2.2.2 Modify Service Plan (Package/Profile) ................................................................................................ 51

2.2.3 Get Service Plan by Uplink................................................................................................................... 53

2.2.4 Get Service Plan by Downlink .............................................................................................................. 54

2.2.5 Get Service Plan by Uplink and Downlink ............................................................................................ 55

2.2.6 Get all Service Plans ............................................................................................................................ 56

2.2.7 Delete Service Plan .............................................................................................................................. 56

2.2.8 Get Service Plan by ID ......................................................................................................................... 58

2.3 SYSTEM SETTING ...................................................................................................................................... 59

2.3.1 Set Redirect URL and Allow Access to IP.............................................................................................. 59

2.4 DATA USAGE ........................................................................................................................................... 60

2.3.1 Query Data Usage by Hour Size ...................................................................................................... 60

2.4.2 Query Data Usage CDR Detail ......................................................................................................... 62

APPENDIX: ACTIVATE SUBSCRIBER AND BIND APN IPFLOW DIAGRAM ........................................................... 65

v
1. API Overview
The Baicells Application Programming Interface (API) is a Representational State Transfer, or RESTful,
API that accepts and receives JavaScript Object Notations (JSON). The API utilizes common Hypertext
Transfer Protocol (HTTP) methods such as GET, POST, PATCH, and DELETE.
The Baicells API header is added to the basic HTTP authentication mode via HTTP requests, provided
there is prior agreement with partners on a common user name and password. Permissions for the
API are inherited from the user account.
When submitting a request using basic HTTP authentication, you must also include a header for
“Content-Type” that specifies “application/json”; a header for “cloud_key” that specifies the
operator’s cloud_key; and a header for “Authorization” that specifies the encoded value of
“username:password” through the base64.
Table 1-1 provides the result_code list for when an operation fails.
Table 1-1: Result_Code List
Code Message

4000 sub_id field is required

4001 sub_idConflict

4002 Subscribers do not exist


4003 Subscribers do not bind imsi
4004 Subscribers do not bind service plan
4005 Subscribers already exist
4006 Subscriber already binds service plan

4007 Subscriber already binds imsi


4008 Session_id field is required
4009 Subscriber does not match this cloud_key

4010 Sub_id_list field is required

4011 Subscribers do not exist or do not bind imsi and service plan
4012 Number of subscribers is too many

4100 Ip field is required

4101 Ip is not a valid IP address

4102 apn_profile field is required


4103 APN does not exist

4104 APN does not contain this IP address


4105 Bind relation (Subscribers-apn-ip) does not exist

4106 Bind relation already exists

1
4107 Bind relation does not exist
4108 apn_name is required

4109 Data too long for apn_name

4110 apn_ambr_ul is required

4111 apn_ambr_ul format error


4112 apn_ambr_dl is required

4113 apn_ambr_dl format error

4200 Service_plan_id field is required

4201 Service_plan_id conflict

4202 Service plan does not exist

4203 New_Service_plan_id field is required


4205 Service_plan_name field is required

4206 datanode is required

4207 Service plan does not match this cloud_key


4300 IMSI field is required
4301 IMSI format error

4302 IMSI has been used

4303 Please deactivate the subscriber before unbinding imsi!


4401 Uplink field is required

4402 Downlink field is required


4403 Uplink must be a number

4404 Downlink must be a number

4501 Sub_list field is required

4502 Sub_list format error


4503 Exceeded 200 records limit
4601 Configure 16 IP addresses at most

4602 url field is required

4603 url_ip field is required

4701 Begin time is required

4702 End time is required

4703 Incorrect time format


4704 Query usage by hour size. Time interval should not exceed 31 days.

4705 Query CDR detail. Time interval should not exceed 7 days.

2
5001 System error
5002 cloud_key is required in request header

5003 cloud_key does not exist

5004 User or password error

5005 User does not match this cloud_key


Code Message

2. API List
North American CloudCore API URL: http://baiboss.cloudapp.net:47081/baicellsapi"

2.1 Subscriber Category

2.1.1 Query Subscriber


1) Detail
POST http://ipaddr:port/baicellsapi/customers/query

param
Field Data Type Description

session_id String Business serial number

imsi String IMSI

Example request:
POST /baicellsapi/customers/query HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"imsi": "460010000000001"

Success 200

Field Data Type Description

session_id String Business serial number


result_code String Successfully create a subscriber return code:200

3
available boolean true:the imsi can be user
false:the imsi cannot be user

sub_id String The internal ID of the subscriber

sub_name String The name of the subscriber

id_num String The ID number of the subscriber

phone_number String The phone number of the subscriber


email String The email address of the subscriber

address String The address of the subscriber

service_plan_id String The subscriber bound service plan

sub_status String The status of the subscriber


“0”:active
“1”:deactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": “200”,

"available": false,

"sub_id": "20161201",

"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address",

"service_plan_id": "2016001",

"sub_status": "0"

} or

"session_id": "2016123456",

"result_code": “200”,

"available": true

4
2.1.2 Create Subscriber
1) Detail
POST http://ipaddr:port/baicellsapi/customers/create

param
Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

sub_name String The name of the subscriber

id_num String The ID number of the subscriber


phone_number String The phone number of the subscriber

email String The email of the subscriber

address String The address of the subscriber

Example request:
POST /baicellsapi/customers/create HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201",

"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address"

Success 200
Field Data Type Description

session_id String Business serial number


result_code String Successfully create a subscriber return code:200

message String Message:Success

5
Example response - If the success return status code is 200, it is applicable to all interfaces:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

Error 422

Field Data Type Description

session_id String Business serial number


result_code String Error return code:4000/4001

message String Message: sub_id conflict

Example response - If the fail return status code is 422, it is applicable to all interfaces:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4001",

"message": "sub_id conflict"

2.1.3 Bind Service Plan


1) Detail
POST http://ipaddr:port/baicellsapi/customers/bindservice

param
Field Data Type Description
session_id String Business serial number

sub_id String The internal ID of the subscriber

6
service_plan_id String The internal ID of the service plan

Example request:
POST /baicellsapi/customers/bindservice HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201",

"service_plan_id": "2016001"

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code":"200",

"message": "Success"

Error 422

Field Data Type Description

session_id String Business serial number


result_code String Error return code:4000/4002/4200/4202

message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

7
{

"session_id": "2016123456",

"result_code": "4002"

"message": "subscriber dose not exist"

2.1.4 Bind IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/customers/bindimsi

param
Field Data Type Description

session_id String Business serial number


sub_id String The internal ID of the subscriber
imsi String IMSI

Example request:
POST /baicellsapi/customers/bindimsi HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201",

"imsi": "460010000000001"

Success 200
Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200


message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

8
{

"session_id": "2016123456",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code: 4000/4002/4300/4301/4302

message String Message

Example response
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4301"

"message": "IMIS formate error"

2.1.5 Unbind IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/customers/unbindimsi

param
Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers/unbindimsi HTTP/1.1

Content-Type: application/json

9
"session_id":"2016123456",

"sub_id": "20161201"

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description

session_id String Business serial number


result_code String Error return code: 4000/4002/5001
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscriber dose not exist"

10
2.1.6 Activate Subscriber
1) Detail
POST http://ipaddr:port/baicellsapi/customers /activate

param
Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers /activate HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"sub_id": "20161201"

Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200


message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

11
Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code: 4000/4002/4003/4004/5001

message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.7 Deactivate Subscriber


1) Detail
POST http://ipaddr:port/baicellsapi/customers/deactivate

param

Field Data Type Description


session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers/deactivate HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"sub_id": "20161201"

12
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code":"200",

"message": "Success"

Error 422
Field Data Type Description
session_id String Business serial number

result_code String Error return code: 4000/4002/5001


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.8 Change Service Plan


1) Detail
POST http://ipaddr:port/baicellsapi/customers/update

13
param

Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

new_service_plan_id String The new service plan id

Example request:
POST /baicellsapi/customers/update HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"sub_id": "20161201",

"new_service_plan_id": "2016001"

Success 200
Field Data Type Description
session_id String Business serial number

result_code String Successfully create a subscriber return code:200


message String Message:Success

Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"session_id": "2016123456",
“result_code”: “200”,
"message": "Success"
}

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code: 4000/4002/4202/5001

14
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.9 Change Speed (Uplink and Downlink)


1) Detail
POST http://ipaddr:port/baicellsapi/customers/updateuplink

param
Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

uplink int Uplink speed.Unit:MB

downlink int Downlink speed.Unit:MB

Example request:
POST /baicellsapi/customers/updateuplink HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"sub_id": "20161201",

"downlink": 5,

"uplink": 5

15
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": “200”,

"message": "Success"

Error 422
Field Data Type Description
session_id String Business serial number

result_code String Error return code:


4000/4002/4401/4402/4403/4404/5001
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.10 Bulk Activate Subscribers


1) Detail
POST http://ipaddr:port/baicellsapi/customers/bulkactivate

16
param

Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers/bulkactivate HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"data":[

"20161201",

"20161202",

"20161203",

"20161204"

Success 200

Field Data Type Description

session_id String Business serial number


result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

17
Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code: 5001

message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "5001",

"message": "System error"

2.1.11 Bulk Deactivate Subscribers


1) Detail
POST http://ipaddr:port/baicellsapi/customers/bulkdeactivate

param

Field Data Type Description


session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers/bulkdeactivate HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"data":[

"20161201",

"20161202",

"20161203",

"20161204"

18
]

Success 200

Field Data Type Description

session_id String Business serial number


result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

Error 422
Field Data Type Description
session_id String Business serial number

result_code String Error return code: 5001


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "5001",

"message": "System error"

19
2.1.12 Query Subscriber by sub_id
1) Detail
POST http://ipaddr:port/baicellsapi/customers/querybyid

param

Field Data Type Description

session_id String Business serial number

sub_id String The ID number of the subscriber

Example request:
POST /baicellsapi/customers/querybyid HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201"

Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200


imsi String imsi
sub_id String The internal ID of the subscriber

sub_name String The name of the subscriber

id_num String The ID number of the subscriber

phone_number String The phone of the subscriber


email String The email of the subscriber

address String The address of the subscriber

service_plan_id String The subscriber bound service plan


sub_status String The status of the subscriber:
“0”:active
“1”:deactive

up_rate String Up speed of bind service plan

20
down_rate String Down speed of bind service plan
apn_info_list JSON String Bind apn ip information

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: "200",

"imsi": "460010000000001",

"sub_id": "20161201",

"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address",

"service_plan_id": "2016001",

"sub_status": "0",

"up_rate":"5",

"down_rate":"10",

"apn_info_list":[{"apn_name":"apn1","apn_ambr_ul":4,"apn_ambr_dl":8,
"ipv4":"192.168.1.10"}]

2.1.13 Bind APN and Static IP

NOTE: Not supported in North America CloudCore, but is supported in a Local OMC+BOSS
environment

1) Detail
POST http://ipaddr:port/baicellsapi/customers/bindapnip

param

Field Data Type Length Description

session_id String Business serial number

21
sub_id String The internal ID of the subscriber
apn_name String 100 Apn name

apn_ambr_ul int 7 apn_ambr_ul

apn_ambr_dl int 7 apn_ambr_dl

type_of_context String 1 Is default APN: 0-normal,1-default


static_ip_setting String 1 Bind the static IP: 0-no, 1-yes

ip_addr String 40 IP address


NOTE: If you do not set a static IP, this parameter
should be set to empty or you should delete the
parameter.

Example request:
POST /baicellsapi/customers/bindapnip HTTP/1.1

Content-Type: application/json

1. Set static ip addr param:


{

"session_id":"2016123456",

"sub_id": "2017062201",

"apn_name": "apn1",

"apn_ambr_ul": 4,

"apn_ambr_dl": 8,

"type_of_context": 0,

"static_ip_setting": 1

"ip_addr": "192.168.1.10"

2. Do not set static ip addr param:


{

"session_id":"2016123456",

"sub_id": "2017062201",

"apn_name": "apn1",

"apn_ambr_ul": "4",

"apn_ambr_dl": "8"

"type_of_context": 0,

"static_ip_setting": 0

22
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code:


4108/4109/4110/4111/4112/4113
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4108"

"message": "apn_name is required"

23
2.1.14 Remove APN and Static IP

NOTE: Not supported in North America CloudCore, but is supported in a Local OMC+BOSS
environment

1) Detail
POST http://ipaddr:port/baicellsapi/customers/removeapnip

param
Field Data Type Description

session_id String Business serial number

sub_id String The internal ID of the subscriber


apn_name String Apn name

apn_ambr_ul String apn_ambr_ul


apn_ambr_dl String apn_ambr_dl

Example request:
POST /baicellsapi/customers/removeapnip HTTP/1.1

Content-Type: application/json

1. Set static ip addr param:


{

"session_id":"2016123456",

"sub_id": "2017062201",

"apn_name": "apn1",

"apn_ambr_ul": "4",

"apn_ambr_dl": "8"

Success 200

Field Data Type Description

session_id String Business serial number


result_code String Successfully create a subscriber return code:200

message String Message:Success

24
Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code: 4000/4108/


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4108"

"message": "apn_name is required"

2.1.15 Modify Subscriber


1) Detail
POST http://ipaddr:port/baicellsapi/customers/modify

param

Field Data Type Description


session_id String Business serial number

sub_id String The internal ID of the subscriber

sub_name String The name of the subscriber

25
id_num String The ID number of the subscriber
phone_number String The phone of the subscriber

email String The email of the subscriber

address String The address of the subscriber

Example request:
POST /baicellsapi/customers/modify HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201",

"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address"

Success 200
Field Data Type Description
session_id String Business serial number

result_code String Successfully create a subscriber return code:200


message String Subscriber does not exist

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

26
Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code:4000/4002/5001

message String Message: sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscribers dose not exist"

2.1.16 Delete Subscriber


1) Detail
POST http://ipaddr:port/baicellsapi/customers/delete

param

Field Data Type Description


session_id String Business serial number

sub_id String The internal ID of the subscriber

Example request:
POST /baicellsapi/customers/delete HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"sub_id": "20161201"

27
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Subscriber does not exist

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

Error 422
Field Data Type Description
session_id String Business serial number

result_code String Error return code:4000/4002/5001


message String Message: sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4002",

"message": "Subscribers dose not exist"

2.1.17 Bulk Create Subscriber


1) Detail
POST http://ipaddr:port/baicellsapi/customers/bulkcreate

28
param

Field Data Type Description

session_id String Business serial number

service_plan_id String The service of the subscriber

sub_list list The collection of user list

sub_id String The internal ID of the subscriber


imsi String The imsi of the subscriber

id_num String The ID number of the subscriber

phone_number String The phone number of the subscriber

email String The email of the subscriber

address String The address of the subscriber

Example request:
POST /baicellsapi/customers/create HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"service_plan_id": "2016001",

"sub_list":[{

"sub_id": "20161201",

"sub_name": "test name",

"imsi":"860100011223344",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address"

},

"sub_id": "20161202",

"sub_name": "test name2",

"imsi":"860100011223355",

"id_num": "123457",

"phone_number": "1234567",

"email": "[email protected]",

29
"address": "test2 address"

}]

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return code:200

message String Message:Success

total int The total number of these operations


successful quantity Int The number of successes

unsuccessful quantity int The number of failures

success_list list The list of successes


fail_list list The list of failures

sub_id The internal ID of the subscriber

imsi The imsi of the subscriber


result_message Error message

1. Parameters format error returned information:


Example response:
HTTP/1.1 422

"session_id": "198575111866",

"result_code": "4503",

"message": "exceed 200 records limit."

2. Parameters format pass, return operations details:

HTTP/1.1 200

"session_id": "198575111866",

"total": 200,

"successful quantity": 29,

30
"unsuccessful quantity": 171,

"success_list": [

"sub_id": "66268756728",

"imsi": "601011010167723"

},

"sub_id": "66268751752",

"imsi": "601011010167747"

}...

],

"fail_list": [

"sub_id": "66268766671",

"imsi": "601011000166666",

"result_code": "4302",

"result_message": "imsi has been used."

"sub_id": "66268866706aa",

"imsi": "601011000166701",

"result_code": "5001",

"result_message": "system error."

},

"sub_id": "66268866707",

"imsi": "601111000167702",

"result_code": "4001",

"result_message": "sub_id conflict."

}...

31
2.1.18 Subscriber Redirection
1)Detail
POST http://ipaddr:port/baicellsapi/customers/redirect

param
Field Data Type Description

session_id String Business serial number


Sub_id_list JSONArray Sub_id list

Example request:
POST http://ipaddr:port/baicellsapi/customers/redirect HTTP/1.1

Content-Type: application/json

"session_id":"198575111866",

"sub_id_list":["AX1234","AX1235","AX1236"]

Success 200

Field Data Type Description

result_code String Successfully create a subscriber return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

“result_code”: “200”,

"message": "Success"

Error 422

Field Data Type Description


result_code String Error return code: 4010/4011

32
message String Message:sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"result_code": "4001",

"message": "some error"

2.1.19 Subscriber Cancel Redirection


1)Detail
POST http://ipaddr:port/baicellsapi/customers/cancelredirect

param
Field Data Type Description
session_id String Business serial number

Sub_id_list String Sub_id list

Example request:
POST http://ipaddr:port/baicellsapi/customers/cancelredirect HTTP/1.1

Content-Type: application/json

"session_id":"198575111866",

"sub_id_list":["AX1234","AX1235","AX1236"]

Success 200

Field Data Type Description


result_code String Successfully create a subscriber return
code:200

message String Message:Success

33
Example response:
HTTP/1.1 200 OK

Content-Type: application/json

“result_code”: “200”,

"message": "Success"

Error 422

Field Data Type Description

result_code String Error return code: 4010/4011


message String Message:sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"result_code": "4001",

"message": "some error"

2.1.20 Query Subscriber by IP


1) Detail
POST http://ipaddr:port/baicellsapi/customers/querybyip

param

Field Data Type Description

session_id String Business serial number

Ip_addr String Ip_addr

Example request:
POST /baicellsapi/customers/query HTTP/1.1

Content-Type: application/json

34
"session_id":"2016123456",

"ip_addr": "192.169.1.1"

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return


code:200

available boolean true:the imsi can be user


false:the imsi can not be user

sub_id String The internal ID of the subscriber


sub_name String Thename of the subscriber

id_num String The ID number of the subscriber

phone_number String The phone of the subscriber


email String The email of the subscriber

address String The address of the subscriber

service_plan_id String The subscriber bound service plan

sub_status String The suatus of subscriber


“0”:active
“1”:deactive
svc_state String The status of redirection
“0”:no redirection
“1”:direction

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"available": false,

"sub_id": "20161201",

"sub_name": "test name",

35
"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address",

"service_plan_id": "2016001",

"sub_status": "0",

"svc_state": "0"

} or

"session_id": "2016123456",

"result_code": “200”,

"available": true

2.1.21 Activate Subscriber by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/activate

param
Field Data Type Description

session_id String Business serial number

imsi String The imsi of the subscriber

Example request:
POST /baicellsapi/imsi/activate HTTP/1.1

Content-Type: application/json

"session_id": "201805180958",

"imsi": "600000000000081"

36
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return


code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805180958",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code: 4000/4002/4003/4004/5001


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805180958",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.22 Deactivate Subscriber by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/deactivate

37
param

Field Data Type Description

session_id String Business serial number

imsi String The IMSI of the subscriber

Example request:
POST /baicellsapi/imsi/deactivate HTTP/1.1

Content-Type: application/json

"session_id": "201805181105",

"imsi": "600000000000081"

Success 200

Field Data Type Description


session_id String Business serial number
result_code String Successfully create a subscriber return
code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805181105",

"result_code":"200",

"message": "Success"

Error 422
Field Data Type Description

session_id String Business serial number

result_code String Error return code: 4000/4002/5001

38
message String Message

Example response
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805181105",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.23 Subscriber Redirection by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/redirect

param
Field Data Type Description

session_id String Business serial number

imsi_list JSONArray imsi list

Example request:
POST http://ipaddr:port/baicellsapi/imsi/redirect HTTP/1.1

Content-Type: application/json

"session_id":"201805181511",

"imsi": "600000000000081"

Success 200
Field Data Type Description

result_code String Successfully create a subscriber return


code:200

message String Message:Success

39
Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805181105",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description


result_code String Error return code: 4301

message String Message: imsi format error

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805181105",

"result_code": "4301",

"message": "imsi format error"

2.1.24 Subscriber Cancel Redirection by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/cancelredirect

param

Field Data Type

session_id String
imsi_list String

Example request:
POST http://ipaddr:port/baicellsapi/imsi/cancelredirect HTTP/1.1

40
Content-Type: application/json

"session_id":"201805181515",

"imsi": "600000000000081"

Success 200

Field Data Type Description

result_code String Successfully create a subscriber return


code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id":"201805181515",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description

result_code String Error return code: 4301


message String Message: imsi format error

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id":"201805181515",

"result_code": "4301",

"message": "imsi format error"

41
2.1.25 Change Speed by IMSI (Uplink and Downlink)
1) Detail
POST http://ipaddr:port/baicellsapi/imsi/updatespeed

param

Field Data Type Length Description

session_id String Business serial number

imsi String The imsi of the subscriber

uplink Int 10 Uplink speed.Unit:MB(maxinum:1000Mb)

downlink Int 10 Downlink speed.Unit:MB(maxinum:1000Mb)

Example request:
POST /baicellsapi/imsi/updatespeed HTTP/1.1

Content-Type: application/json

"session_id": "201805181529",

"imsi": "600000000000081",

"downlink": 5,

"uplink": 5

Success 200
Field Data Type Description
session_id String Business serial number

result_code String Successfully create a subscriber return


code:200
message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805181529",

42
"result_code": “200”,

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code:


4000/4002/4401/4402/4403/4404/5001
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805181529",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.26 Query Subscriber by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/query

param
Field Data Type Description
session_id String Business serial number

imsi String The imsi of the subscriber

Example request:
POST /baicellsapi/imsi/query HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

43
"imsi": "600000000000081"

Success 200

Field Data Tpe Description

session_id String Business serial number


result_code String Successfully create a subscriber return
code:200

imsi String imsi

sub_id String The internal ID of the subscriber


sub_name String The name of the subscriber

id_num String The ID number of the subscriber

phone_number String The phone of the subscriber


email String The email of the subscriber

address String The address of the subscriber

service_plan_id String The subscriber bound service plan


sub_status String The status of subscriber
“0”:active
“1”:deactive
up_rate String Up speed of bind service plan
down_rate String Down speed of bind service plan
apn_info_list JSONArray Bind apn ip information

svc_state String The status of redirection


“0”:no redirection
“1”:direction

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805181625",

“result_code”: "200",

"imsi": "600000000000081",

"sub_id": "20161201",

44
"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address",

"service_plan_id": "2016001",

"sub_status": "0",

"up_rate":"5",

"down_rate":"10",

"svc_state":"0",

"apn_info_list":[{"apn_name":"apn1","apn_ambr_ul":4,"apn_ambr_dl":8,
"ipv4":"192.168.1.10"}]

2.1.27 Change Service Plan by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/changeservice

param

Field Data Type Description

session_id String Business serial number


imsi String The imsi of the subscriber
new_service_plan_id String The new service plan id

Example request:
POST /baicellsapi/imsi/updateservice HTTP/1.1

Content-Type: application/json

"session_id": "201805221515",

"imsi": "600000000000081",

"new_service_plan_id": "2016001"

45
Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return


code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805221515",

"result_code": “200”,

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code: 4000/4002/4202/5001


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805221515",

"result_code": "4002",

"message": "Subscriber dose not exist"

2.1.28 Modify Subscriber by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/modify

46
param

Field Data Type Length Description

session_id String Business serial number

imsi String The imsi of the subscriber

sub_name String 60 The name of the subscriber

id_num String 20 The ID number of the subscriber


phone_number String 20 The phone of the subscriber

email String 60 The email of the subscriber

address String 200 The address of the subscriber

Example request:
POST /baicellsapi/imsi/modify HTTP/1.1

Content-Type: application/json

"session_id":"201805221541",

"imsi": "600000000000081",

"sub_name": "test name",

"id_num": "123456",

"phone_number": "123456",

"email": "[email protected]",

"address": "test address"

Success 200
Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return


code:200

message String Subscribers dose not exist

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

47
{

"session_id": "201805221541",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code:4000/4002/5001

message String Message: sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805221541",

"result_code": "4002",

"message": "Subscribers dose not exist"

2.1.29 Delete Subscriber by IMSI


1) Detail
POST http://ipaddr:port/baicellsapi/imsi/delete

param
Field Data Type Description

session_id String Business serial number

imsi String The imsi of the subscriber

Example request:
POST /baicellsapi/imsi/delete HTTP/1.1

Content-Type: application/json

48
"session_id":"201805221455",

"imsi": "600000000000081"

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return


code:200

message String Subscribers dose not exist

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "201805221455",

"result_code": "200",

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code:4000/4002/5001

message String Message: sub_id conflict

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "201805221455",

"result_code": "4002",

"message": "Subscribers dose not exist"

49
2.2 Service Plan (Package/Profile) Category

2.2.1 Create Service Plan (Package/Profile)


1) Detail
POST http://ipaddr:port/baicellsapi/products/create

param

Field Data Type Description

session_id String Business serial number

service_plan_id String The internal ID of the service plan


service_plan_name String The name of the service plan

uplink int Uplink speed.Unit:MB


downlink int Downlink speed.Unit:MB
comments String

Example request:
POST /products/create HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"service_plan_id": "2016001",

"service_plan_name": "testname",

"uplink": 5,

"downlink": 5,

"comments": "comments"

Success 200

Field Data Type Description


session_id String Business serial number

result_code String Successfully create a subscriber return code:200


message String Message:Success

50
Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

Error 422

Field Data Type Description


session_id String Business serial number

result_code String Error return code:


4200/4201/4401/4402/4403/4404/5001
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "5001",

"message": "System error"

2.2.2 Modify Service Plan (Package/Profile)


1) Detail
POST http://ipaddr:port/baicellsapi/products/modify

param

Field Data Type Description


session_id String Business serial number

service_plan_id String The internal ID of the service plan

51
service_plan_name String The name of the service plan
uplink int Uplink speed.Unit:MB

downlink int Downlink speed.Unit:MB

comments String Comments

Example request:
POST /products/modify HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"service_plan_id": "2016001",

"service_plan_name": "testname",

"uplink": 5,

"downlink": 5,

"comments": "comments"

Success 200

Field Data Type Description


session_id String Business serial number
result_code String Successfully create a subscriber return code:200
message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

52
Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code:


4200/4201/4401/4402/4403/4404/5001

message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "5001",

"message": "System error"

2.2.3 Get Service Plan by Uplink


1) Detail
GET http://ipaddr:port/baicellsapi/products/querybyuplink/{uplink}

Success 200
Field Data Type Description

state String 0:active; 1:inactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"service_plan_id":"T201611220001",

"service_plan_name":"1M",

"uplink":"1",

"downlink":"1",

53
"state":"0"

},

"service_plan_id":"T201611220002",

"service_plan_name":"1M",

"uplink":"1",

"downlink":"2",

"state":"0"

2.2.4 Get Service Plan by Downlink


1) Detail
GET http://ipaddr:port/baicellsapi/products/querybydownlink/{downlink}

Success 200
Field Data Type Description

state String 0:active; 1:inactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"service_plan_id":"T201611220001",

"service_plan_name":"2M",

"uplink":"2",

"downlink":"2",

"state":"0"

},

"service_plan_id":"T201611220002",

"service_plan_name":"2M",

54
"uplink":"1",

"downlink":"2",

"state":"0"

2.2.5 Get Service Plan by Uplink and Downlink


1) Detail
GET http://ipaddr:port/baicellsapi/products/querybylink/{uplink}/{downlink}

Success 200

Field Data Type Description

state String 0:active; 1:inactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"service_plan_id":"T201611220001",

"service_plan_name":"2M",

"uplink":"2",

"downlink":"2",

"state":"0"

},

"service_plan_id":"T201611220002",

"service_plan_name":"2M",

"uplink":"2",

"downlink":"2",

"state":"0"

55
2.2.6 Get all Service Plans
1) Detail
GET http://ipaddr:port/baicellsapi/products/queryallplans

Success 200

Field Data Type Description

state String 0:active; 1:inactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"service_plan_id":"T201611220001",

"service_plan_name":"1M",

"uplink":"1",

"downlink":"1",

"state":"0"

},

"service_plan_id":"T201611220002",

"service_plan_name":"2M",

"uplink":"2",

"downlink":"2",

"state":"0"

2.2.7 Delete Service Plan


1) Detail
POST http://ipaddr:port/baicellsapi/products/delete

56
param

Field Data Type Description

session_id String Business serial number

service_plan_id String The internal ID of the service plan

Example request:
POST /products/modify HTTP/1.1

Content-Type: application/json

"session_id": "2016123456",

"service_plan_id": "2016001"

Success 200

Field Data Type Description


session_id String Business serial number
result_code String Successfully return code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

“result_code”: “200”,

"message": "Success"

Error 422
Field Data Type Description

session_id String Business serial number


result_code String Error return code:
4200/4202/4207/5001

57
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "5001",

"message": "System error"

2.2.8 Get Service Plan by ID


1) Detail
GET http://ipaddr:port/baicellsapi/products/querybyid/{service_plan_id}

Success 200
Field Data Type Description

state String 0:active;1:inactive

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"service_plan_id":"T201611220001",

"service_plan_name":"2M",

"uplink":"2",

"downlink":"2",

"state":"0"

58
2.3 System Setting

2.3.1 Set Redirect URL and Allow Access to IP


1)Detail
POST http://ipaddr:port/baicellsapi/system/setredirecturl

param
Field Data Type Length Description
url String 200 complete path of redirection

url_ip String 40 The IP address of the directional URL


alow_ips Sequence A list of IP allowed to access.Maximum quantity
16

Example request:
POST http://ipaddr:port/baicellsapi/system/setredirecturl HTTP/1.1

Content-Type: application/json

"session_id":"123456",

"url":"http://www.xxx.xxx:8080/balancedue",

"url_ip": "192.168.9.10",

"allow_ip_list":["172.17.0.10","172.17.0.20"]

Success 200

Field Data Type Description

result_code String Successfully create a subscriber return


code:200

message String Message:Success

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

“result_code”: “200”,

"message": "Success"

59
}

Error 422

Field Data Type Description

result_code String Error return code:5001/4601

message String Message:system error

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"result_code": "5001",

"message": "system error"

2.4 Data Usage

2.3.1 Query Data Usage by Hour Size

NOTE: Not supported in North America CloudCore, but is supported in a Local OMC+BOSS
environment

1) Detail
POST http://ipaddr:port/baicellsapi/usage/querybyhour

param
Field Data Type Required Description

session_id String Yes Business serial number

imsi String No If the imsi is not empty query the


specified IMSI’s usage. If imsi is empty
query all IMSI’s usage.

begin_time String Yes Time interval of queries, Format:yyyy-


MM-dd hh:mm:ss
The maximum time interval is 31 days.

end_time String Yes Time interval of queries,Format:yyyy-


MM-dd hh:mm:ss

60
The maximum time interval is 31 days.

Example request:
POST /baicellsapi/usage/querybyhour HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"imsi":"600000000000001",

"begin_time":"2018-11-22 08:00:00",

"end_time":"2018-11-22 12:00:00"

Success 200
Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200


usage_infos JSONArray Return data list
imsi String imsi

total_usage String Unit (KB)


up_usage String Unit (KB)
down_usage String Unit (KB)

usage_time String Time of Statistical usage. For example:(2018-11-22


10:00:00) means the usage data from 9 o'clock to 10
o'clock.

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "200",

"usage_infos":[

"imsi":"600000000000001",

"total_usage":"204800",

61
"up_usage":"1000",

"down_usage":"203800",

"usage_time":"2018-11-22 10:00:00"

Error 422

Field Data Type Description

session_id String Business serial number

result_code String Error return code: 4701/4702/4703/4704


message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4701"

"message": "begin time is required"

2.4.2 Query Data Usage CDR Detail

NOTE: Not supported in North America CloudCore, but is supported in a Local OMC+BOSS
environment

1) Detail
POST http://ipaddr:port/baicellsapi/usage/querycdr

param
Field Data Type Required Description
session_id String Yes Business serial number

imsi String No If the imsi is not empty query the specified IMSI’s
usage. If imsi is empty query all IMSI’s usage.

62
begin_time String Yes Time interval of queries, Format:yyyy-MM-dd
hh:mm:ss
The maximum time interval is 7 days.

end_time String Yes Time interval of queries, Format:yyyy-MM-dd


hh:mm:ss
The maximum time interval is 7 days.

Example request:
POST /baicellsapi/usage/querybyhour HTTP/1.1

Content-Type: application/json

"session_id":"2016123456",

"imsi":"600000000000001",

"begin_time":"2018-11-22 08:00:00",

"end_time":"2018-11-22 12:00:00"

Success 200

Field Data Type Description

session_id String Business serial number

result_code String Successfully create a subscriber return code:200


cdr_infos JSONArray Return data list
imsi String imsi
total_usage String Unit (Byte)

up_usage String Unit (Byte)

down_usage String Unit (Byte)

duration String Unit(second)


cdrdate String The time to generate this CDR. Format:yyyy-MM-dd
hh:mm:ss

Example response:
HTTP/1.1 200 OK

Content-Type: application/json

"session_id": "2016123456",

63
"result_code": "200",

"cdr_infos":[

"imsi":"600000000000001",

"total_usage":"204800",

"up_usage":"1000",

"down_usage":"203800",

"duration":"300",

"cdrdate":"2018-11-22 12:14:32"

Error 422
Field Data Type Description
session_id String Business serial number
result_code String Error return code: 4701/4702/4703/4705
message String Message

Example response:
HTTP/1.1 422 OK

Content-Type: application/json

"session_id": "2016123456",

"result_code": "4701"

"message": "begin time is required"

64
Appendix: Activate Subscriber and Bind APN IPflow
Diagram
Follow the steps below and the flow diagram to activate the subscriber and bind the APN IP.
1. Create a subscriber.
2. Bind the service plan for this subscriber. If there is no suitable tariff that can be used, create a
new service plan following the information in section 2.2.1.
3. Bind IMSI for this subscriber.
4. Activate this subscriber.
At this point, the IMSI can access the network.

65

You might also like