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 mendetory
number Subscriber mobile number. Eg: 94777123456 mandatory
status current status
NOTFOUND : User subscription not found
mandatory

#Unsubscriing/Subscribing a User from an application Unsubscribe 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

#Unsubscriing/Subscribing a User from micro subscription Unsubscribe 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
Last updated on 21st Apr 2017