Admin Api
This api will provide the facility to query subscribers of the application and to deactivate if necessary. Every service provider needs to implement an admin api as per below specification and communicate the end point to Dialog Ideabiz team. This API will be connected with Admin interface for Dialog customer care frontline to query and to take necessary actions as per customer request.
Version : 1.1
Date : 2015-06-08
Sample Codes
Java classes models
https://github.com/ideabizlk/Ideabiz-adminapp-common-models
Java Spring Sample service
https://github.com/ideabizlk/Ideabiz-adminapp-remote-api
API Specification
Search Subscribers
Searching subscriber in an application
Method : GET
Accept : application/json
URL
{URL}/subscriber/{number}
Example
http://myapp.com/adminapi/subscriber/94777123456
http://myapp.com/adminapi/index.php?r=/subscriber/94777123456
Response
Found
{
"subscription": {
"number": "94777123456",
"status": "SUBSCRIBED",
"registration": {
"datetime": "2014-05-20 10:33:11",
"method": "SMS"
},
"unregistration": {
"datetime": "2014-05-20 10:33:11",
"method": "SMS"
},
"microSubscriotions": {
"count": 1,
"details" :[
{
"msisdn":"94777123456",
"serviceID":"SVC_001",
"serviceName":"Education Service",
"chargeType":"DAILY",
"amount":3.0,
}
]
}
}
}
Field | Description | Mandatory |
---|---|---|
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
status | Current status UNSUBSCRIBED : User already unsubscribed SUBSCRIBED : User has active subscription |
Mandatory |
registration | User registration info | Mandatory |
registration -> datetime | User registration timestamp | Mandatory |
registration -> method | User registration method values : SMS, WEB, USSD |
Mandatory |
unregistration | User registration info if no unregistration information, this should null |
Optional |
unregistration -> datetime | User registration timestamp | Mandatory |
unregistration -> method | User registration method values : SMS, WEB, USSD, ADMIN |
0. |
History
Similar as above searching a subscriber. Difference is pagination available for history
URL
{URL}/subscriber/{number}/history/{offset}/{limit}
Example
http://myapp.com/adminapi/subscriber/94777123456/history/10/20
http://myapp.com/adminapi/index.php?r=/subscriber/94777123456/history/10/20
Found
{
"subscriberHistory": {
"number": "94777123456",
"offset": 10,
"limit": 0,
"history": [
{
"datetime": "2014-05-20 10:33:11",
"trigger": "ADMIN",
"event": "UNSUBSCRIBE",
"note": "",
"status": "SUCCESS",
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SYSTEM",
"event": "CHARGING",
"note": "no funds",
"status": "FAILED"
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SYSTEM",
"event": "SMS",
"note": "",
"status": "SUCCESS"
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SUBSCRIBER",
"event": "SUBSCRIBE",
"note": "",
"status": "SUCCESS"
}
]
}
}
Field | Description | Mandatory |
---|---|---|
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
offset | Offset of current response | Mandatory |
limit | Limit of current response | Mandatory |
history | Last 10 events regarding specific user this array contain object of history |
Mandatory |
history -> datetime | Event timestamp | Mandatory |
history -> trigger | Actor of the trigerred event. Eg : SYSTEM,SUBSCRIBER,ADMIN |
Mandatory |
history -> event | event type Eg: SUBSCRIBE, UNSUBSCRIBE, SMS, USSD, CHARGING |
Mandatory |
history -> note | any note as string | Mandatory |
history -> status | specific event status Eg : SUCCESS, FAILED |
Mandatory |
Not Found
{
"subscription": {
"number": "94777123456",
"status": "NOTFOUND"
}
}
Field | Description | Mandatory |
---|---|---|
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
status | current status NOTFOUND : User subscription not found |
Mandatory |
#Unsubscribing/Subscribing a user from an application Unsubscribe a specific user from the application
Method : POST
Accept : application/json
{URL}/subscriber/{number}/{action}/via/{method}
Example
http://myapp.com/adminapi/subscriber/94777123456/unsubscribe/via/SMS
http://myapp.com/adminapi/index.php?r=/subscriber/94777123456/unsubscribe/via/SMS
User Unsubscription
{
"subscription": {
"number": "94777123456",
"status": "UNSUBSCRIBED",
}
}
Field | Description | Mandatory |
---|---|---|
action | unsubscribe or subscribe |
Mandatory |
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
status | Unsubscribe status UNSUBSCRIBED : Successfully removed user from the application NOTFOUND : User subscription not found NOTCHANGED : User not subscribed to an application or unsubcription failed |
Mandatory |
#Unsubscribing/Subscribing a User from micro subscription Unsubscribe a specific user from the application
Method : POST
Accept : application/json
{URL}/subscriber/{number}/{action}/via/{method}/serviceID/{serviceID}
Example
http://myapp.com/adminapi/subscriber/94777123456/unsubscribe/via/SMS/serviceID/SVC_001/
http://myapp.com/adminapi/index.php?r=/subscriber/94777123456/unsubscribe/via/SMS/serviceID/SVC_001/
User Unsubscription
{
"micrSubscription": {
"method":"WEB",
"msisdn":"94777123456",
"serviceID":"SVC_001",
"serviceName":"Education Service",
"chargeType":"DAILY",
"amount":3.0,
"status":"UNSUBSCRIBED"
}
}
Field | Description | Mandatory |
---|---|---|
action | unsubscribe or subscribe |
Mandatory |
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
status | Unsubscribe status UNSUBSCRIBED : Successfully removed user from the application NOTFOUND : User subscription not found NOTCHANGED : User not subscribed to an application or unsubcription failed |
Mandatory |
Micro Service History
Similar as above searching a subscriber. Difference is pagination available for history
URL
{URL}/subscriber/{number}/history/serviceID/{serviceID}/{offset}/{limit}
Example
http://myapp.com/adminapi/subscriber/94777123456/history/serviceID/SVC_001/10/20
http://myapp.com/adminapi/index.php?r=/subscriber/94777123456/history/serviceID/SVC_001/10/20
Found
{
"subscriberHistory": {
"number": "94777123456",
"offset": 10,
"limit": 0,
"history": [
{
"datetime": "2014-05-20 10:33:11",
"trigger": "ADMIN",
"event": "UNSUBSCRIBE",
"note": "",
"status": "SUCCESS",
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SYSTEM",
"event": "CHARGING",
"note": "no funds",
"status": "FAILED"
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SYSTEM",
"event": "SMS",
"note": "",
"status": "SUCCESS"
},
{
"datetime": "2014-05-20 10:33:11",
"trigger": "SUBSCRIBER",
"event": "SUBSCRIBE",
"note": "",
"status": "SUCCESS"
}
]
}
}
Field | Description | Mandatory |
---|---|---|
number | Subscriber mobile number. Eg: 94777123456 | Mandatory |
offset | Offset of current response | Mandatory |
limit | Limit of current response | Mandatory |
history | Last 10 events regarding specific user this array contain object of history |
Mandatory |
history -> datetime | Event timestamp | Mandatory |
history -> trigger | Actor of the trigerred event. Eg : SYSTEM,SUBSCRIBER,ADMIN |
Mandatory |
history -> event | event type Eg: SUBSCRIBE, UNSUBSCRIBE, SMS, USSD, CHARGING |
Mandatory |
history -> note | any note as string | Mandatory |
history -> status | specific event status Eg : SUCCESS, FAILED |
Mandatory |
Error Response
HTTP response code should be in the format of 5xxx
{
"error": {
"statusCode": "ERROR",
"message": "Unable to proccess request",
}
}
#Security check for incoming API call Upon receiving an API call, please validate the IP
IP Validation
Source IP : 202.69.200.34