Query All the YCM Users

Query the information of all the YCM users.

Request URL

GET {base_url}/dm/open_api/v2/users

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String Pass the access token in the header.

Format: Bearer {access_token}.

Query parameters
Table 1.
Parameter Required Type Description
pageSize No Integer Define how many records per page.
  • Default value: 10
  • Maximum value: 50
pageNumber No Integer Define which page is displayed.
  • Default value: 1
sort No String

Define the sorting field.

You can enter the response parameters in this sorting field to sort the response result.

Examples:

  • userId: Sort the records by user ID in ascending order.
  • -userId: Sort the records by user ID in descending order.

Response parameters

Parameter Type Description
data Object <Details> The detailed information.
requestId String The unique ID of the request, which can be used to quickly locate the request.
status String Request result:
  • Success
  • Failed
time Long The response time.
Note: The YCM API response returns a timestamp, you can convert the timestamp to detailed date and time as needed. For more information, see Convert Timestamp to Local Date and Time.
Details
Parameter Type Description
pageSize Integer How many records are displayed per page.
pageNumber Integer Which page is displayed.
total Integer The total number of YCM users.
list Array <User_Info> The information list of the YCM user.
User_Info
Parameter Type Description
userId Long The ID of the YCM user.
company String Company name.
firstName String First name.
lastName String Last name.
email String Email.
phone String Phone number.
mobile String Mobile number.
address String Address.
remark String Remark.
createdCloudPbx Integer The number of created PBXs.
userType String User type.
  • My Colleague
  • Reseller

Example

Request example

Query all the YCM users:

  • Display 2 records per page.
  • Display Page 1.
  • Sort the records by user ID in ascending order.
GET /dm/open_api/v2/users?pageSize=2&pageNumber=1&sort=userId HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21Kd3RQYXlsb2FkSW5mbyI6eyJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJ5c0lkIjoxNzg5NjM2MDM5MDg1MDI1NzM0OSwidmVyc2lvbiI6MTYzODk1OTkwOSwicmVmcmVzaFZlcnNpb24iOjE2Mzg5NjI4NDB9LCJzY29wZSI6WyJhbGwiXSwiZXhwIjoxNjM4OTY0NjQwLCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiJmZjBiNWM1MS03YjBhLTQwYjYtYTRkNS04ZWZkMzY1OGJlZDkiLCJjbGllbnRfaWQiOiJrcDl5eW50bXVlc3VrNWpvV3ZNa1RiQ0J4cU82TEtSaCJ9.RNiea7bNZtBO5QWvnChhK8m-Bcg_qSZY5gods0Gq7z0

Response example

HTTP/1.1 200 OK
{
    "data": {
        "pageSize": 2,
        "pageNumber": 1,
        "total": 50,
        "list": [
            {
                "userId": 10691,
                "company":"Yeastar",
                "firstName": "Ball",
                "lastName": "Leo",
                "email": "leo@example.com",
                "mobile": "13911111111",
                "createdCloudPbx": 5,
                "userType": "My Colleague"
            },
            {
                "userId": 11000,
                "company": "Yeastar",
                "lastName": "Terrell",
                "email": "terrell@example.com",
                "mobile": "13922222222",
                "createdCloudPbx": 3,
                "userType": "Reseller"
            }
        ]
    },
    "requestId": "fdb09869-40bd-4c0a-98b0-21009cb7bea8",
    "status": "Success",
    "time": 1644471460
}