### Python Example to Get an Active Directory Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/ActiveDirectoryApi.md Python code snippet illustrating how to use the `jcapiv2` library to fetch a single Active Directory by its ID. The example includes API key configuration, instantiation of the API client, parameter setup, and basic error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of this Active Directory instance. content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) x_org_id = '' # str | (optional) (default to ) try: # Get an Active Directory api_response = api_instance.activedirectories_get(id, content_type, accept, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_get: %s\n" % e) ``` -------------------------------- ### Python Example: List System Insights System System Info Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md Demonstrates how to call the `systeminsights_list_system_system_info` API using the `jcapiv2` Python client. It shows API key configuration, parameter setup, and error handling for retrieving system information. Note: The provided example is truncated. ```Python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Python API Client Setup Example Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/UserGroupAssociationsApi.md This partial Python code snippet shows the basic setup for using the JumpCloud API client, including importing necessary modules and configuring API key authorization. It serves as a common preamble for making API calls. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Python Example: Update System User Binding (Partial) Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SystemusersApi.md A partial Python code example for interacting with the systemusers_systems_binding_put API endpoint. It shows the initial imports and setup for making API calls. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint ``` -------------------------------- ### List System Insights Programs API and Python Example Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md Provides the API specification and a Python code example for listing system insights programs using the JumpCloud API. The example demonstrates API client initialization, parameter setup, making the API call, and basic error handling. ```python api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) x_org_id = '' # str | (optional) (default to ) try: # List System Insights Programs api_response = api_instance.systeminsights_list_programs(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_programs: %s\n" % e) ``` ```APIDOC Method: systeminsights_list_programs Description: List System Insights Programs Parameters: - Name: content_type Type: str Description: Notes: [default to application/json] - Name: accept Type: str Description: Notes: [default to application/json] - Name: limit Type: int Description: Notes: [optional] [default to 10] - Name: skip Type: int Description: The offset into the records to return. Notes: [optional] [default to 0] - Name: filter Type: list[str] Description: Supported operators are: eq Notes: [optional] [default to []] - Name: x_org_id Type: str Description: Notes: [optional] [default to ] Return Type: list[SystemInsightsPrograms] Authorization: x-api-key HTTP Request Headers: - Content-Type: application/json - Accept: application/json ``` -------------------------------- ### Create JumpCloud Policy using API and Python Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/PoliciesApi.md This snippet outlines how to create a new policy via the JumpCloud API. It provides API documentation for the `policies_post` endpoint, a cURL example for making the POST request, and a Python example showing API key configuration. Note that the Python example is partial and focuses on setup. ```APIDOC Endpoint: policies_post Method: POST Description: Create a new Policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. Parameters: content_type: str (default: application/json) accept: str (default: application/json) body: object (required) - Policy parameters to create the new policy. x_org_id: str (optional, default: ) Return Type: PolicyWithDetails Authorization: x-api-key HTTP Request Headers: Content-Type: application/json Accept: application/json ``` ```bash curl -X POST https://console.jumpcloud.com/api/v2/policies \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: {API_KEY}' \ -d '{ {Policy_Parameters} }' ``` ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Python Example: Initialize API Client for User Group Traversal Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/UserGroupsApi.md Demonstrates how to initialize the `jcapiv2` Python client, including API key configuration, for interacting with user group related API endpoints. Note that this example only covers client setup and not the full API call for `graph_user_group_traverse_system_group`. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' ``` -------------------------------- ### List System Insights Bitlocker Info (Partial Example) Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md This snippet provides the initial setup for calling the JumpCloud System Insights API to list Bitlocker information, including API key configuration. The full API call and error handling are not included in this partial example. The API method supports filtering by `system_id` and `protection_status`. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` ```APIDOC Method: systeminsights_list_bitlocker_info Description: List System Insights Bitlocker Info Valid filter fields are `system_id` and `protection_status`. ``` -------------------------------- ### cURL Example: List All System Groups Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemGroupsApi.md A sample cURL command demonstrating how to send a GET request to list all System Groups. This example shows the required headers for content type, acceptance, and API key authentication. ```bash curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### Get Specific Policy Examples Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/PoliciesApi.md Examples demonstrating how to retrieve a specific policy's details using both cURL and the Python `jcapiv2` library. These snippets show the necessary API key configuration, request parameters, and how to process the API response. ```bash curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: {API_KEY}' ``` ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy object. content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) x_org_id = '' # str | (optional) (default to ) try: # Gets a specific Policy. api_response = api_instance.policies_get(id, content_type, accept, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policies_get: %s\n" % e) ``` -------------------------------- ### List System Insights System Programs API and Python Example Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md This snippet documents the API endpoint and provides a Python example for retrieving a list of programs installed on a specific system. It demonstrates API key authentication, parameter usage including filtering, and error handling for the API call. ```APIDOC systeminsights_list_system_programs(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) Description: List System Insights System Programs Valid filter fields: name Parameters: system_id: str content_type: str (default: application/json) accept: str (default: application/json) limit: int (optional, default: 10) skip: int (optional, default: 0) - The offset into the records to return. filter: list[str] (optional, default: []) - Supported operators are: eq x_org_id: str (optional, default: ) Return type: list[SystemInsightsPrograms] Authorization: x-api-key HTTP Request Headers: Content-Type: application/json Accept: application/json ``` ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.SystemInsightsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) x_org_id = '' # str | (optional) (default to ) try: # List System Insights System Programs api_response = api_instance.systeminsights_list_system_programs(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_system_programs: %s\n" % e) ``` -------------------------------- ### Python Example: List LDAP Servers for User Group Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/UserGroupsApi.md Partial Python code demonstrating the initial setup for calling the `graph_user_group_traverse_ldap_server` API endpoint using the `jcapiv2` library. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint ``` -------------------------------- ### Python Example to List Active Directories Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/ActiveDirectoryApi.md Python code snippet illustrating how to use the `jcapiv2` library to fetch a list of all Active Directories. The example includes API key configuration, instantiation of the API client, parameter setup for filtering and pagination, and basic error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.ActiveDirectoryApi(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 = 10 # 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 ) try: # List Active Directories api_response = api_instance.activedirectories_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_list: %s\n" % e) ``` -------------------------------- ### cURL Example to List Active Directories Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/ActiveDirectoryApi.md Sample cURL command demonstrating how to make a GET request to the `activedirectories/` endpoint. This example shows the necessary headers for content type, acceptance, and API key authentication to retrieve a list of all Active Directory instances. ```curl curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### cURL Example: List All Command Results Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/CommandResultsApi.md A sample cURL command demonstrating how to make a GET request to the JumpCloud API to list all command results, including necessary headers and API key authentication. ```shell curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` -------------------------------- ### Configure JumpCloud API Key Authentication in Python Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md This Python example demonstrates the basic setup for authenticating with the JumpCloud API using an API key. It shows how to import necessary modules, configure the API key, and prepare for API calls. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Python Example: Get Specific Office 365 Translation Rule Setup Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/Office365Api.md Illustrates the initial setup for making API calls to retrieve an Office 365 translation rule using the `jcapiv2` Python client, including API key configuration. Note: The actual API call is not present in this snippet. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Python Example: List an Individual System using SystemsApi Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SystemsApi.md Illustrates how to programmatically retrieve details of a system using the `jcapiv1` Python client library. The example sets up API key authentication and prepares for the API call. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` -------------------------------- ### Install JumpCloud API Python Client via Setuptools Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/README.md Provides the shell command to install the `jcapiv1` Python client using Setuptools. This is an alternative installation method, often used for local development or custom builds. ```sh python setup.py install --user ``` -------------------------------- ### Python Example: List Salesforce Knowledge Articles Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/KnowledgeApi.md Provides a complete Python code example demonstrating how to configure API key authentication, instantiate the `KnowledgeApi` client, and call the `knowledge_salesforce_list` method with various optional parameters. Includes error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.KnowledgeApi(jcapiv2.ApiClient(configuration)) fields = ['[\"id\",\"body\",\"title\",\"publishedDate\"]'] # list[str] | (optional) (default to ["id","body","title","publishedDate"]) filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) limit = 10 # 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 []) try: # List Knowledge Articles api_response = api_instance.knowledge_salesforce_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling KnowledgeApi->knowledge_salesforce_list: %s\n" % e) ``` -------------------------------- ### Python Example: Get Active Directory Agent Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/ActiveDirectoryApi.md Illustrates how to retrieve details of a specific Active Directory agent using the `jcapiv2` Python client. This snippet provides the basic setup for making the API call. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint ``` -------------------------------- ### Get Job Details (Python) Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/BulkJobRequestsApi.md An incomplete example demonstrating the initial setup for retrieving job details using the JumpCloud API Python client. Note that the API endpoint itself is marked as not functional yet. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint ``` -------------------------------- ### Python Example: Retrieve System Etc Hosts Info Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md Provides a Python code example demonstrating how to configure the jcapiv2 client with an API key and call the systeminsights_list_system_etc_hosts method. It shows how to pass required and optional parameters and includes basic error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.SystemInsightsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) x_org_id = '' # str | (optional) (default to ) try: # List System Insights System Etc Hosts api_response = api_instance.systeminsights_list_system_etc_hosts(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_system_etc_hosts: %s\n" % e) ``` -------------------------------- ### cURL Example: Get System Group Details Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemGroupsApi.md A sample cURL command demonstrating how to send a GET request to retrieve details of a System Group. This example shows the required headers for content type, acceptance, and API key authentication. ```bash curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### cURL Example to Get an Active Directory Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/ActiveDirectoryApi.md Sample cURL command demonstrating how to make a GET request to the `activedirectories/{ActiveDirectory_ID}` endpoint. This example shows the necessary headers for content type, acceptance, and API key authentication to retrieve a specific Active Directory instance. ```curl curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### List All JumpCloud Application Templates Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/ApplicationTemplatesApi.md This snippet provides API documentation and code examples for fetching a list of all available SSO/SAML Application Templates. It includes a Python client example (partial) and a cURL command, outlining the endpoint, parameters, return type, and authorization. ```cURL curl -X GET https://console.jumpcloud.com/api/application-templates \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: {API_KEY}' ``` ```Python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['x-api-key'] = 'Bearer' ``` ```APIDOC API Endpoint: GET /application-templates Description: List Application Templates Parameters: - Name: content_type, Type: str - Name: accept, Type: str - Name: fields, Type: str (optional) - Name: limit, Type: int (optional) - Name: skip, Type: int (optional) - Name: sort, Type: str (optional) - Name: filter, Type: str (optional) - Name: x_org_id, Type: str (optional) Return Type: Applicationtemplateslist Authorization: x-api-key HTTP Request Headers: Content-Type: application/json Accept: application/json ``` -------------------------------- ### Search Systems with Python API Client Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SearchApi.md Illustrates how to use the `jcapiv1` Python client library to call the `search_systems_post` API endpoint. This example covers configuring the API key, setting up the API instance, defining request parameters, and handling potential `ApiException` errors during the API call. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) body = jcapiv1.Search() # Search | (optional) fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = 'filter_example' # str | A filter to apply to the query. (optional) try: # Search Systems api_response = api_instance.search_systems_post(content_type, accept, body=body, fields=fields, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SearchApi->search_systems_post: %s\n" % e) ``` -------------------------------- ### List System Insights Safari Extensions API and Python Example Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md Provides the API specification and a Python code example for listing system insights Safari extensions. The example includes API key configuration, parameter setup, making the API call, and error handling. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.SystemInsightsApi(jcapiv2.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) x_org_id = '' # str | (optional) (default to ) try: # List System Insights Safari Extensions api_response = api_instance.systeminsights_list_safari_extensions(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_safari_extensions: %s\n" % e) ``` ```APIDOC Method: systeminsights_list_safari_extensions Description: List System Insights Safari Extensions Valid filter fields are `system_id` and `name`. Parameters: - Name: content_type Type: str Description: Notes: [default to application/json] - Name: accept Type: str Description: Notes: [default to application/json] - Name: limit Type: int Description: Notes: [optional] [default to 10] - Name: skip Type: int Description: The offset into the records to return. Notes: [optional] [default to 0] - Name: filter Type: list[str] Description: Supported operators are: eq Notes: [optional] [default to []] - Name: x_org_id Type: str Description: Notes: [optional] [default to ] Return Type: list[SystemInsightsSafariExtensions] Authorization: x-api-key HTTP Request Headers: - Content-Type: application/json - Accept: application/json ``` -------------------------------- ### Python Example: Search System Users via JumpCloud API Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SearchApi.md Demonstrates how to programmatically search for system users using the `jcapiv1` Python client library. It includes steps for configuring API key authorization and making a POST request with various optional parameters. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) body = jcapiv1.Search() # Search | (optional) fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) filter = 'filter_example' # str | A filter to apply to the query. (optional) limit = 10 # 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) x_org_id = '' # str | (optional) (default to ) try: # Search System Users api_response = api_instance.search_systemusers_post(content_type, accept, body=body, fields=fields, filter=filter, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SearchApi->search_systemusers_post: %s\n" % e) ``` -------------------------------- ### Python Example: List System User Bindings Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SystemusersApi.md Provides a Python code example for calling the systemusers_systems_binding_list API. It shows how to configure the API client, set parameters, and handle potential exceptions. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) limit = 10 # 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 = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) filter = 'filter_example' # str | A filter to apply to the query. (optional) x_org_id = '' # str | (optional) (default to ) try: # List system user binding api_response = api_instance.systemusers_systems_binding_list(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->systemusers_systems_binding_list: %s\n" % e) ``` -------------------------------- ### Python Example for Launching Command Trigger Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/CommandTriggersApi.md Illustrates how to use the `jcapiv1` Python client to launch a command via a trigger. This example covers configuring API key authorization, creating an API instance, setting required parameters, and handling potential API exceptions during the `command_trigger_webhook_post` call. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.CommandTriggersApi(jcapiv1.ApiClient(configuration)) triggername = 'triggername_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) x_org_id = '' # str | (optional) (default to ) try: # Launch a command via a Trigger api_instance.command_trigger_webhook_post(triggername, content_type, accept, x_org_id=x_org_id) except ApiException as e: print("Exception when calling CommandTriggersApi->command_trigger_webhook_post: %s\n" % e) ``` -------------------------------- ### Sample cURL Request to Get LDAP Server Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/LDAPServersApi.md Provides a cURL command example for making a GET request to the `ldapservers/{LDAP_ID}` endpoint, demonstrating how to include necessary headers like `Accept`, `Content-Type`, and `x-api-key`. ```bash curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### cURL Example: Get Organization Details Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/OrganizationsApi.md A sample cURL command demonstrating how to make a GET request to the `/organizations` endpoint to retrieve organization details, including necessary headers for content type, accept, and API key. ```curl curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### Python Example: List All Command Results Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/CommandResultsApi.md Demonstrates how to use the `jcapiv1` Python client to list all command results. This example includes configuring API key authorization, initializing the API client, setting various query parameters, and handling potential API exceptions. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.CommandResultsApi(jcapiv1.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) limit = 10 # 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 = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) filter = 'filter_example' # str | A filter to apply to the query. (optional) x_org_id = '' # str | (optional) (default to ) try: # List all Command Results api_response = api_instance.command_results_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandResultsApi->command_results_list: %s\n" % e) ``` -------------------------------- ### Python Example: Retrieve System Disk Info Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/SystemInsightsApi.md Provides a Python code example demonstrating how to configure the jcapiv2 client with an API key and call the systeminsights_list_system_disk_info method. It shows how to pass required and optional parameters and includes basic error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.SystemInsightsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) x_org_id = '' # str | (optional) (default to ) try: # List System Insights System Disk Info api_response = api_instance.systeminsights_list_system_disk_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_system_disk_info: %s\n" % e) ``` -------------------------------- ### Python Example: List User Group Parents Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/UserGroupMembersMembershipApi.md Demonstrates how to use the `graph_user_group_member_of` method in Python to retrieve parent user groups. This example includes API key configuration, parameter setup, and error handling for API exceptions. ```python from __future__ import print_function import time import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv2.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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.UserGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) limit = 10 # 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 ) try: # List the User Group's parents api_response = api_instance.graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupMembersMembershipApi->graph_user_group_member_of: %s\n" % e) ``` -------------------------------- ### List All Systems (Python) Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SystemsApi.md This Python example shows how to fetch a list of all systems from the JumpCloud API. It includes API key configuration, setting up content and accept headers, and demonstrates how to use optional parameters like 'limit', 'skip', 'sort', and 'filter' for pagination and data refinement. Error handling for API exceptions is also included. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) x_org_id = '' # str | (optional) (default to ) search = 'search_example' # str | A nested object containing a string `searchTerm` and a list of `fields` to search on. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) filter = 'filter_example' # str | A filter to apply to the query. (optional) try: # List All Systems api_response = api_instance.systems_list(content_type, accept, fields=fields, limit=limit, x_org_id=x_org_id, search=search, skip=skip, sort=sort, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->systems_list: %s\n" % e) ``` -------------------------------- ### JumpCloud API v2 Example: List User Groups Source: https://github.com/thejumpcloud/jcapi-python/blob/master/README.md Illustrates how to initialize the JumpCloud API v2 client with an API key and retrieve a list of all user groups. This example focuses on basic API configuration and a single GET request. ```python """JumpCloud API v2 example.""" import jcapiv2 from jcapiv2.rest import ApiException API_KEY = "YOUR_API_KEY" CONTENT_TYPE = "application/json" ACCEPT = "application/json" # Set up the configuration object with your API key for authorization CONFIGURATION = jcapiv2.Configuration() CONFIGURATION.api_key['x-api-key'] = API_KEY # Instantiate the API object for the group of endpoints you need to use, # for instance the user groups API API_INSTANCE = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(CONFIGURATION)) def get_user_groups(): """Make an API call to retrieve all user groups.""" try: user_groups = API_INSTANCE.groups_user_list(CONTENT_TYPE, ACCEPT) print(user_groups) except ApiException as err: print("Exception when calling UserGroupsApi->groups_user_list: %s\n" % err) if __name__ == "__main__": get_user_groups() ``` -------------------------------- ### Example: List System Groups Bound to User Groups with cURL Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv2/docs/UserGroupAssociationsApi.md Provides a sample cURL command to demonstrate how to make a GET request to the `graph_user_group_traverse_system_group` endpoint. This example includes the necessary headers for content type, acceptance, and API key authentication. ```curl curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: {API_KEY}' ``` -------------------------------- ### Python Example: Update a System using jcapiv1 Source: https://github.com/thejumpcloud/jcapi-python/blob/master/jcapiv1/docs/SystemsApi.md Demonstrates how to update a system using the `jcapiv1` Python client library. The example covers API key configuration, instantiating the API client, preparing parameters, and handling potential API exceptions during the update operation. ```python from __future__ import print_function import time import jcapiv1 from jcapiv1.rest import ApiException from pprint import pprint # Configure API key authorization: x-api-key configuration = jcapiv1.Configuration() configuration.api_key['x-api-key'] = 'YOUR_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 = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | content_type = 'application/json' # str | (default to application/json) accept = 'application/json' # str | (default to application/json) body = jcapiv1.Systemput() # Systemput | (optional) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) x_org_id = '' # str | (optional) (default to ) try: # Update a system api_response = api_instance.systems_put(id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->systems_put: %s\n" % e) ```