All URIs are relative to https://api.opsgenie.com
Method | HTTP request | Description |
---|---|---|
create_user | POST /v2/users | Create User |
delete_user | DELETE /v2/users/{identifier} | Delete User |
get_user | GET /v2/users/{identifier} | Get User |
list_user_escalations | GET /v2/users/{identifier}/escalations | List User Escalations |
list_user_forwarding_rules | GET /v2/users/{identifier}/forwarding-rules | List User Forwarding Rules |
list_user_schedules | GET /v2/users/{identifier}/schedules | List User Schedules |
list_user_teams | GET /v2/users/{identifier}/teams | List User Teams |
list_users | GET /v2/users | List users |
update_user | PATCH /v2/users/{identifier} | Update User (Partial) |
SuccessResponse create_user(body)
Create User
Creates a user with the given payload
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
body = swagger_client.CreateUserPayload() # CreateUserPayload | Request payload of the user object
try:
# Create User
api_response = api_instance.create_user(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | CreateUserPayload | Request payload of the user object |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse delete_user(identifier)
Delete User
Delete user with the given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
try:
# Delete User
api_response = api_instance.delete_user(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->delete_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetUserResponse get_user(identifier, expand=expand)
Get User
Get user for the given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
expand = ['expand_example'] # list[str] | Comma separated list of strings to create a more detailed response. The only expandable field for user api is 'contact' (optional)
try:
# Get User
api_response = api_instance.get_user(identifier, expand=expand)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->get_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched | |
expand | list[str] | Comma separated list of strings to create a more detailed response. The only expandable field for user api is 'contact' | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserEscalationsResponse list_user_escalations(identifier)
List User Escalations
List escalations of the user for the given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
try:
# List User Escalations
api_response = api_instance.list_user_escalations(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->list_user_escalations: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserForwardingRulesResponse list_user_forwarding_rules(identifier)
List User Forwarding Rules
List user forwarding rules for the given user identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
try:
# List User Forwarding Rules
api_response = api_instance.list_user_forwarding_rules(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->list_user_forwarding_rules: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched |
ListUserForwardingRulesResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserSchedulesResponse list_user_schedules(identifier)
List User Schedules
List schedules of the user for the given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
try:
# List User Schedules
api_response = api_instance.list_user_schedules(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->list_user_schedules: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserTeamsResponse list_user_teams(identifier)
List User Teams
List user teams for the given user identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
try:
# List User Teams
api_response = api_instance.list_user_teams(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->list_user_teams: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUsersResponse list_users(limit=limit, offset=offset, sort_field=sort_field, order=order, query=query)
List users
List users with given parameters
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
limit = 100 # int | Number of users to retrieve (optional) (default to 100)
offset = 0 # int | Number of users to skip from start (optional) (default to 0)
sort_field = 'sort_field_example' # str | Field to use in sorting. Should be one of 'username', 'fullName' and 'insertedAt' (optional)
order = 'asc' # str | Direction of sorting. Should be one of 'asc' or 'desc' (optional) (default to asc)
query = 'query_example' # str | Field:value combinations with most of user fields to make more advanced searches. Possible fields are username, fullName, blocked, verified, role, locale, timeZone, userAddress and createdAt (optional)
try:
# List users
api_response = api_instance.list_users(limit=limit, offset=offset, sort_field=sort_field, order=order, query=query)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->list_users: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number of users to retrieve | [optional] [default to 100] |
offset | int | Number of users to skip from start | [optional] [default to 0] |
sort_field | str | Field to use in sorting. Should be one of 'username', 'fullName' and 'insertedAt' | [optional] |
order | str | Direction of sorting. Should be one of 'asc' or 'desc' | [optional] [default to asc] |
query | str | Field:value combinations with most of user fields to make more advanced searches. Possible fields are username, fullName, blocked, verified, role, locale, timeZone, userAddress and createdAt | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse update_user(identifier, body=body)
Update User (Partial)
Update user with the given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user to be searched
body = swagger_client.UpdateUserPayload() # UpdateUserPayload | Request payload of the user object (optional)
try:
# Update User (Partial)
api_response = api_instance.update_user(identifier, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user to be searched | |
body | UpdateUserPayload | Request payload of the user object | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]