Skip to content

Latest commit

 

History

History
520 lines (357 loc) · 20.1 KB

InvitesApi.md

File metadata and controls

520 lines (357 loc) · 20.1 KB

corellium.InvitesApi

Request timeouts

Every API method accepts _request_timeout in seconds: a positive float for the urllib3 total timeout, or a pair of positive floats (connect, read). This controls HTTP transport waiting, not how long the server operation may run. It is not a wall-clock deadline for the operation or for all retries combined.

Transport timeouts raise urllib3.exceptions.TimeoutError subclasses such as ReadTimeoutError and ConnectTimeoutError. When retries are exhausted, urllib3 can instead raise urllib3.exceptions.MaxRetryError; inspect its reason to distinguish a timeout from other connection failures. Retry behavior depends on the HTTP method and Configuration.retries. These are client-side exceptions, not HTTP response statuses or SDK ApiException responses.

A timeout does not guarantee cancellation or rollback of an operation accepted by the server. For example, after a start request times out, the instance may still be starting or may already be running; the timeout alone does not establish its state or mean it was stopped or destroyed. The request might not have reached the server at all, leaving the instance off. Treat the outcome as unknown and fetch the instance's current state before deciding whether to retry. If it has since been destroyed, that lookup may return not found; the timeout itself does not prove destruction. Do not blindly repeat a state-changing request.

Catch urllib3.exceptions.TimeoutError and urllib3.exceptions.MaxRetryError separately from the SDK ApiException. MaxRetryError is not a subclass of TimeoutError. With _with_http_info the same rules apply. With _without_preload_content, a read timeout may also occur later when reading the returned response body.

All URIs are relative to https://app.corellium.com/api

Method HTTP request Description
v3_create_invites POST /v3/invites Create invites
v3_edit_invites POST /v3/invites/edit Edit invites
v3_get_invite_by_token POST /v3/invites-by-token Get an invite by token
v3_list_invites GET /v3/invites List invites
v3_revoke_invites POST /v3/invites/revoke Revoke invites
v3_signup_from_invite POST /v3/invites/signup Sign up from an invite

v3_create_invites

Dict[str, InviteResult] v3_create_invites(create_invites_body)

Create invites

Required role: Domain administrator or project administrator.

Invites people by email to create an account in your domain. Requires a domain or project administrator. Each person is emailed a signup link; they create their account with v3SignupFromInvite. Use settings to add them to teams and give them project access automatically when they sign up.

The response has one entry per email address: either the created invite, or an error. An address fails if someone in your domain already uses it, or if it already has a pending invite. To email a pending invite again, send the same address with resend: true; this issues a new signup link and the old one stops working.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.create_invites_body import CreateInvitesBody
from corellium.models.invite_result import InviteResult
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    create_invites_body = corellium.CreateInvitesBody() # CreateInvitesBody | 

    try:
        # Create invites
        api_response = api_instance.v3_create_invites(create_invites_body)
        print("The response of InvitesApi->v3_create_invites:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_create_invites: %s\n" % e)

Parameters

Name Type Description Notes
create_invites_body CreateInvitesBody

Return type

Dict[str, InviteResult]

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Invite results keyed by email. -
403 Domain administrator or project administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_edit_invites

Invitation v3_edit_invites(edit_invites_body)

Edit invites

Required role: Domain administrator or project administrator.

Changes the teams and projects a pending invite will grant when the person signs up. Requires a domain or project administrator. Only the first invite matching the given IDs is changed, so send one ID per request. Team and project IDs not in your domain are dropped. Returns the invite after the change. The person is not emailed again.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.edit_invites_body import EditInvitesBody
from corellium.models.invitation import Invitation
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    edit_invites_body = corellium.EditInvitesBody() # EditInvitesBody | 

    try:
        # Edit invites
        api_response = api_instance.v3_edit_invites(edit_invites_body)
        print("The response of InvitesApi->v3_edit_invites:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_edit_invites: %s\n" % e)

Parameters

Name Type Description Notes
edit_invites_body EditInvitesBody

Return type

Invitation

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The edited invite. -
403 Domain administrator or project administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_get_invite_by_token

InvitationByToken v3_get_invite_by_token(get_invite_by_token_body)

Get an invite by token

Looks up an invitation from the token in a signup link, so a signup page can show which domain and email the invite is for before the person creates their account. Needs no sign-in. Returns 403 if the invite has expired, the token does not match, or the domain is disabled, and 404 if no invite has this token.

Example

import corellium
from corellium.models.get_invite_by_token_body import GetInviteByTokenBody
from corellium.models.invitation_by_token import InvitationByToken
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    get_invite_by_token_body = corellium.GetInviteByTokenBody() # GetInviteByTokenBody | 

    try:
        # Get an invite by token
        api_response = api_instance.v3_get_invite_by_token(get_invite_by_token_body)
        print("The response of InvitesApi->v3_get_invite_by_token:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_get_invite_by_token: %s\n" % e)

Parameters

Name Type Description Notes
get_invite_by_token_body GetInviteByTokenBody

Return type

InvitationByToken

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The invitation. -
400 Missing or invalid token. -
403 The invite has expired, its token does not match, or its domain is disabled. -
404 No invite with the given token. -

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

v3_list_invites

InvitesListResponse v3_list_invites(limit=limit, offset=offset)

List invites

Required role: Domain administrator or project administrator.

Lists invitations that have been sent in your domain but not yet used or revoked, with each invite's email and the teams and projects it will grant. Requires a domain or project administrator. Results are paginated with limit and offset.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.invites_list_response import InvitesListResponse
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    limit = 100 # float | Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. (optional) (default to 100)
    offset = 0 # float | How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. (optional) (default to 0)

    try:
        # List invites
        api_response = api_instance.v3_list_invites(limit=limit, offset=offset)
        print("The response of InvitesApi->v3_list_invites:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_list_invites: %s\n" % e)

Parameters

Name Type Description Notes
limit float Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. [optional] [default to 100]
offset float How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. [optional] [default to 0]

Return type

InvitesListResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of invitations. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
403 Domain administrator or project administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_revoke_invites

RevokeInvitesResponse v3_revoke_invites(revoke_invites_body)

Revoke invites

Required role: Domain administrator or project administrator.

Cancels pending invites, so their signup links stop working. Requires a domain or project administrator. Returns how many invites were removed; IDs that do not match a pending invite in your domain are ignored. People who already signed up are not affected; remove their accounts with DELETE /v3/users/{userId}.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.revoke_invites_body import RevokeInvitesBody
from corellium.models.revoke_invites_response import RevokeInvitesResponse
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    revoke_invites_body = corellium.RevokeInvitesBody() # RevokeInvitesBody | 

    try:
        # Revoke invites
        api_response = api_instance.v3_revoke_invites(revoke_invites_body)
        print("The response of InvitesApi->v3_revoke_invites:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_revoke_invites: %s\n" % e)

Parameters

Name Type Description Notes
revoke_invites_body RevokeInvitesBody

Return type

RevokeInvitesResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Number of invites revoked. -
403 Domain administrator or project administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_signup_from_invite

InviteSignupResponse v3_signup_from_invite(invite_signup_body)

Sign up from an invite

Creates a new user account from the token in an invitation email. Needs no sign-in. The account uses the invited email (or email from a single sign-on provider, if given) as its username. The teams and project access set on the invite are applied, and the invite is then used up. If your domain requires agreeing to its terms, agreed must be true. Returns 403 if the invite has expired or the domain is disabled, and 404 if the token is unknown or already used.

Example

import corellium
from corellium.models.invite_signup_body import InviteSignupBody
from corellium.models.invite_signup_response import InviteSignupResponse
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.InvitesApi(api_client)
    invite_signup_body = corellium.InviteSignupBody() # InviteSignupBody | 

    try:
        # Sign up from an invite
        api_response = api_instance.v3_signup_from_invite(invite_signup_body)
        print("The response of InvitesApi->v3_signup_from_invite:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InvitesApi->v3_signup_from_invite: %s\n" % e)

Parameters

Name Type Description Notes
invite_signup_body InviteSignupBody

Return type

InviteSignupResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The created user. -
400 Invalid signup parameters. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 No invite with the given token. -

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