Skip to content

Latest commit

 

History

History
340 lines (233 loc) · 10.4 KB

File metadata and controls

340 lines (233 loc) · 10.4 KB

rankvectors.APIKeysApi

All URIs are relative to https://api.rankvectors.com

Method HTTP request Description
create_api_key POST /api/api-keys Create API key
delete_api_key DELETE /api/api-keys/{id} Delete API key
list_api_keys GET /api/api-keys List API keys
update_api_key PATCH /api/api-keys/{id} Update API key

create_api_key

ApiKeyResponse create_api_key(create_api_key_request)

Create API key

Create a new API key for the authenticated user

Example

  • Api Key Authentication (ApiKeyAuth):
import rankvectors
from rankvectors.models.api_key_response import ApiKeyResponse
from rankvectors.models.create_api_key_request import CreateApiKeyRequest
from rankvectors.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.rankvectors.com
# See configuration.py for a list of all supported configuration parameters.
configuration = rankvectors.Configuration(
    host = "https://api.rankvectors.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.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with rankvectors.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = rankvectors.APIKeysApi(api_client)
    create_api_key_request = rankvectors.CreateApiKeyRequest() # CreateApiKeyRequest | 

    try:
        # Create API key
        api_response = api_instance.create_api_key(create_api_key_request)
        print("The response of APIKeysApi->create_api_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APIKeysApi->create_api_key: %s\n" % e)

Parameters

Name Type Description Notes
create_api_key_request CreateApiKeyRequest

Return type

ApiKeyResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 API key created successfully -
400 Bad request - invalid parameters -
401 Unauthorized - missing or invalid API key -
500 Internal server error -

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

delete_api_key

DeleteSuggestion200Response delete_api_key(id)

Delete API key

Delete an API key

Example

  • Api Key Authentication (ApiKeyAuth):
import rankvectors
from rankvectors.models.delete_suggestion200_response import DeleteSuggestion200Response
from rankvectors.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.rankvectors.com
# See configuration.py for a list of all supported configuration parameters.
configuration = rankvectors.Configuration(
    host = "https://api.rankvectors.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.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with rankvectors.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = rankvectors.APIKeysApi(api_client)
    id = 'id_example' # str | API key ID

    try:
        # Delete API key
        api_response = api_instance.delete_api_key(id)
        print("The response of APIKeysApi->delete_api_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APIKeysApi->delete_api_key: %s\n" % e)

Parameters

Name Type Description Notes
id str API key ID

Return type

DeleteSuggestion200Response

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 API key deleted successfully -
401 Unauthorized - missing or invalid API key -
404 Not found - resource doesn't exist -
500 Internal server error -

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

list_api_keys

List[ApiKey] list_api_keys()

List API keys

Get all API keys for the authenticated user

Example

  • Api Key Authentication (ApiKeyAuth):
import rankvectors
from rankvectors.models.api_key import ApiKey
from rankvectors.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.rankvectors.com
# See configuration.py for a list of all supported configuration parameters.
configuration = rankvectors.Configuration(
    host = "https://api.rankvectors.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.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

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

    try:
        # List API keys
        api_response = api_instance.list_api_keys()
        print("The response of APIKeysApi->list_api_keys:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APIKeysApi->list_api_keys: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[ApiKey]

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List of API keys -
401 Unauthorized - missing or invalid API key -
500 Internal server error -

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

update_api_key

ApiKey update_api_key(id, update_api_key_request)

Update API key

Update an API key (activate/deactivate or change name)

Example

  • Api Key Authentication (ApiKeyAuth):
import rankvectors
from rankvectors.models.api_key import ApiKey
from rankvectors.models.update_api_key_request import UpdateApiKeyRequest
from rankvectors.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.rankvectors.com
# See configuration.py for a list of all supported configuration parameters.
configuration = rankvectors.Configuration(
    host = "https://api.rankvectors.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.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with rankvectors.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = rankvectors.APIKeysApi(api_client)
    id = 'id_example' # str | API key ID
    update_api_key_request = rankvectors.UpdateApiKeyRequest() # UpdateApiKeyRequest | 

    try:
        # Update API key
        api_response = api_instance.update_api_key(id, update_api_key_request)
        print("The response of APIKeysApi->update_api_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APIKeysApi->update_api_key: %s\n" % e)

Parameters

Name Type Description Notes
id str API key ID
update_api_key_request UpdateApiKeyRequest

Return type

ApiKey

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 API key updated successfully -
400 Bad request - invalid parameters -
401 Unauthorized - missing or invalid API key -
404 Not found - resource doesn't exist -
500 Internal server error -

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