Skip to content

Latest commit

 

History

History
151 lines (110 loc) · 4.34 KB

GroupsApi.md

File metadata and controls

151 lines (110 loc) · 4.34 KB

onelogin.GroupsApi

All URIs are relative to https://your-api-subdomain.onelogin.com

Method HTTP request Description
get_group_by_id GET /api/1/groups/{group_id} Get Group by ID
get_groups GET /api/1/groups Get Groups

get_group_by_id

GetGroups200Response get_group_by_id(group_id)

Get Group by ID

Get Group By ID

Example

  • OAuth Authentication (OAuth2):
import time
import os
import onelogin
from onelogin.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://your-api-subdomain.onelogin.com
# See configuration.py for a list of all supported configuration parameters.
configuration = onelogin.Configuration(
    host = "https://your-api-subdomain.onelogin.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with onelogin.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onelogin.GroupsApi(api_client)
    group_id = 'group_id_example' # str | 

    try:
        # Get Group by ID
        api_response = api_instance.get_group_by_id(group_id)
        print("The response of GroupsApi->get_group_by_id:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling GroupsApi->get_group_by_id: %s\n" % e)

Parameters

Name Type Description Notes
group_id str

Return type

GetGroups200Response

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request -
401 Unauthorized -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_groups

GetGroups200Response get_groups()

Get Groups

Get Groups

Example

  • OAuth Authentication (OAuth2):
import time
import os
import onelogin
from onelogin.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://your-api-subdomain.onelogin.com
# See configuration.py for a list of all supported configuration parameters.
configuration = onelogin.Configuration(
    host = "https://your-api-subdomain.onelogin.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with onelogin.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onelogin.GroupsApi(api_client)

    try:
        # Get Groups
        api_response = api_instance.get_groups()
        print("The response of GroupsApi->get_groups:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling GroupsApi->get_groups: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetGroups200Response

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request -
401 Unauthorized -

[Back to top] [Back to API list] [Back to Model list] [Back to README]