You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

REQUEST

This API is used to get the list of Users in the System.

The structure of API as below:

GET

/user/list

 

It also allows user to query/sort data by some parameters as below:

ParametersDescription
pageThe total you want to display in return message.
per_pageThe total of records you want to display on a page.
order_bySelect the type of order: ascending or descending.
order_dirSelect the field to order data.
activeQuery data by status of user: Active or not
carrier_nameQuery data by Carrier Name. If user is the Carrier User, It will have carrier name.
is_onlineQuery by state of user at this time run query. Is Online or not.
nameQuery data by name of User.
role_idQuery data by Role_ID of User.
user_typeQuery data by type of user: System User, Carrier User of Agent.
create_time_gtQuery data by the date time when the User is created.
create_time_ltQuery data by the date time when the User is created.
last_login_time_gtQuery data by the last date time when the User logged in to the system.
last_login_time_isnullSet it if we don't want to query by login time.
last_login_time_ltQuery data by the last date time when the User logged in to the system.
user_id_inQuery by User_ID.

HEADER

The request requires you given the Token of the Admin in headers because the admin has the permission see the list of the User. To get the Token, please refer Authenticate User for more details.

{
	"accept": "application/json",
	"X-Auth-Token": "Admin Token"
}

 

If you call API without header, the system will return the message as below:

{
  	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "No header X-Auth-Token present",
      	"code": 110,
      	"reason": "auth_token_not_provided"
   	}
}

JSON RESPONSE

There is message return as JSON format. It will return the result of API and the related information as well.

If you provide correct token, the server will return code 200 with a message as below:

{
  	"success": true,
  	"payload": {The list of User}
}

 

If you provide the wrong token, the server will return code 120 with a message as below:

{
   	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "Incorrect token provided",
      	"code": 120,
      	"reason": "incorrect_token_provided"
   	}
}

 

EXAMPLE

We will know more about the API through the example below:

Request

I will call API to get the list of web session as below:

curl \
-H "X-Auth-Token: eyaskjksadkasd9.9123kjsadhkj123jhasdjajsjsdhKS.IH5uHASSJsadnbads980asTHo9dhljM" \
-X GET "http://88.99.175.131:8000/v1/user/list"
 

Response

{
  	"payload": {
    	"per_page": 30,
    	"total": 160,
    	"page": 0,
    	"items": [
      		{
        	"user_id": 1728,
        	"passwd": "$2b$12$.7zF2wbpMawWVJtQQ7jou.g9NWYoeWy7kSmUGMx7psC9dm13/fBIe",
        	"user_type": "client",
        	"active": true,
        	"carrier_name": null,
        	"default_mod": "",
        	"reseller_id": null,
        	"outbound_report": true,
        	"client_limits": [],
        	"last_name": null,
        	"role_id": 1,
        	"last_login_time": null,
        	"all_termination": true,
        	"report_fields": null,
        	"client": null,
        	"report_count": "1 Hour",
        	"name": "rt",
        	"first_name": null,
        	"cdr_expire": null,
        	"is_preload": true,
        	"landing_page": null,
        	"login_ip": null,
        	"default_mod2": "",
        	"avatar_id": null,
        	"create_user_id": null,
        	"create_time": "2018-02-15T03:02:04.870467+00:00",
        	"agent": null,
        	"report_group": true,
        	"auth_ip": [],
        	"default_billing_decimal": 4,
        	"card_id": null,
        	"email": "[email protected]",
        	"last_seen": null,
        	"is_online": 2,
        	"role_name": "Client",
        	"client_id": 2897,
        	"fullname": null,
        	"cdr_api_token": null,
        	"show_carrier_trunk_drop_only": false
      		},
      		{
        	"user_id": 1721,
        	"passwd": "$2b$12$UrGciEsS38GC7zVtoxLEme5F5YIgtFgB3otCqcdA0C8srn9OSjZ2O",
        	"user_type": "client",
        	"active": true,
        	"carrier_name": null,
        	"default_mod": "",
        	"reseller_id": null,
        	"outbound_report": true,
        	"client_limits": [],
        	"last_name": null,
        	"role_id": 1,
        	"last_login_time": null,
        	"all_termination": true,
        	"report_fields": null,
        	"client": null,
        	"report_count": "1 Hour",
        	"name": "Qbfwgz",
        	"first_name": null,
        	"cdr_expire": null,
        	"is_preload": true,
        	"landing_page": null,
        	"login_ip": null,
        	"default_mod2": "",
        	"avatar_id": null,
        	"create_user_id": null,
        	"create_time": "2018-02-14T15:59:45.142396+00:00",
        	"agent": null,
        	"report_group": true,
        	"auth_ip": [],
        	"default_billing_decimal": 4,
        	"card_id": null,
        	"email": "[email protected]",
        	"last_seen": null,
        	"is_online": 2,
        	"role_name": "Client",
        	"client_id": 2892,
        	"fullname": null,
        	"cdr_api_token": null,
        	"show_carrier_trunk_drop_only": false
      		}]
	}
}
  • No labels