cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
496
Views
0
Helpful
1
Replies

CMS API-Check status for 8000 users but API LIMIT 10 entries/request

marwa.ads
Level 1
Level 1

Hi,

I need to check status for all users on CMS by checking user on Call or not.

I've checked CMS API Reference and I've found that i can retrieve information on all active call legs within the system
by calling GET method on the “/callLegs” node.
but there is an issue as CallLegs API retrieve only 10 entries per request and i have more than 8000 users to check status.

Is there a way to get all active connection by one request ?

 

1 Reply 1

b.winter
VIP
VIP

Hi,

no, there is no command to get all entries at once. AFAIK, CMS normally only shows 20 entries per "page".

If you have more entries, then you need to page through the pages via the ?offset=<nr> parameter.

 

E.g. if you have 25 spaces:

When you do https://<ip>:<port>/api/v1/coSpaces,  it only gives you the spaces 1 to 20.

To get the last 5, you need https://<ip>:<port>/api/v1/coSpaces?offset=20. It then shows the spaces 21 to 25.

 

Normally, you will also get the number, how many entries are there in total.

With this number, you can than calculate, how many pages you have in total => How often you need to set the offset.

Let's say 8000 entries in total and 20 entries per page, is 400 pages.

In a program you then could iterate through the pages with a counter starting at 0 end ending at 400-1 (so 399).

Something like this in python:

 

int nr_pages = total_entries / 20;

for
i in range(0, nr_pages-1 // runs from 0 to 399
  // GET API https://<ip>:<port>/api/v1/coSpaces?offset=i*20
// do somethin

 

 

--- Please rate this post as "Helpful" or accept as a solution, if your question has been answered ---