Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group #25

Open
mr-brody opened this issue Jul 18, 2019 · 0 comments
Open

Group #25

mr-brody opened this issue Jul 18, 2019 · 0 comments

Comments

@mr-brody
Copy link

Hi,
I am trying to use the groupsApi for jumpcloud api version2. I've noticed for a few APIs there is a results attribute tied to the returned values. This is good because I can essentially know how many entries exist and can paginate through the results until I reach the end.

For the groups API, I could not find the same. It looks like the datatype returned is a list and only 100 results can be returned in a given API call. This force you to guess how many groups there are. I can compare the current groups to what I have in the console but would like to see if there was another way to perform this action or to file this as a feature improvement for the amount of total entries to be returned in the api call. Below is my code snippet. Thanks!

from __future__ import print_function
import time
import jcapiv2
from jcapiv2.rest import ApiException
from pprint import pprint
import os

# Configure API key authorization: x-api-key
configuration = jcapiv2.Configuration()
configuration.api_key['x-api-key'] = os.environ['jc_api_key']
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = jcapiv2.GroupsApi(jcapiv2.ApiClient(configuration))
content_type = 'application/json' # str |  (default to application/json)
accept = 'application/json' # str |  (default to application/json)
fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned.  (optional) (default to [])
#filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to [])
#limit = 100 # int | The number of records to return at once. Limited to 100. (optional) (default to 10)
#skip = 0 # int | The offset into the records to return. (optional) (default to 0)
sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending.  (optional) (default to [])
#x_org_id = '' # str |  (optional) (default to )


api_response = api_instance.groups_list(content_type, accept, limit=100)
print(type(api_response))
<class 'list'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant