Quick Start

The expected workflow is:

  1. Import and initialize XMSession with an xMatters instance url.

  2. Set the desired authentication method.

  3. Initialize an endpoint.

  4. Execute a method on the endpoint.

Example using basic authentication:

from xmatters import XMSession

xm = XMSession('my-instance.xmatters.com')
xm_session.set_authentication(username='my_username', password='my_password')

people_endpoint = xm_session.get_endpoint('people')
people = people_endpoint.get_people()

for person in people:
    print(person.target_name)

Example using OAuth2 authentication with refresh token:

from xmatters import XMSession

xm_session = XMSession('my-instance.xmatters.com')
xm_session.set_authentication(client_id='my-client-id', refresh_token='my-refresh-token')

people_endpoint = xm_session.get_endpoint('people')
people = people_endpoint.get_people()

for person in people:
    print(person.target_name)

Note

The use of OAuth2 authentication is implied if client_id is provided.