Hacarus.SpectroSdk.ItemsApi
All URIs are relative to https://sdd-api-staging.hacarus.com
Method | HTTP request | Description |
---|---|---|
add_item | POST /api/v1/items/ | Add Item |
annotate | PATCH /api/v1/items/{item_id} | |
del_item | DELETE /api/v1/items/ | |
get_item_by_id | GET /api/v1/items/{item_id} | Get Item by Id |
get_items_by_type | GET /api/v1/items/ | Get List of Items |
add_item
AddItemResponseWrapper add_item(training)
Add Item
Add prediction or training item/s. This endpoint also gives you an option to tag an item as Good or Bad
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import items_api
from Hacarus.SpectroSdk.model.add_item_response_wrapper import AddItemResponseWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = items_api.ItemsApi(api_client)
training = True # bool |
files = [
open('/path/to/file', 'rb'),
] # [file_type] | (optional)
good = True # bool | (optional)
model_id = "model_id_example" # str | (optional)
# example passing only required values which don't have defaults set
try:
# Add Item
api_response = api_instance.add_item(training)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->add_item: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Add Item
api_response = api_instance.add_item(training, files=files, good=good, model_id=model_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->add_item: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
training | bool | ||
files | [file_type] | [optional] | |
good | bool | [optional] | |
model_id | str | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
201 | CREATED | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
annotate
annotate(item_id, annotate_item_request)
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import items_api
from Hacarus.SpectroSdk.model.annotate_item_request import AnnotateItemRequest
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = items_api.ItemsApi(api_client)
item_id = "item_id_example" # str |
annotate_item_request = AnnotateItemRequest(
annotations=[
RequestAnnotation(
x_max=1,
x_min=1,
y_max=1,
y_min=1,
label=1,
notes="notes_example",
),
],
) # AnnotateItemRequest |
# example passing only required values which don't have defaults set
try:
api_instance.annotate(item_id, annotate_item_request)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->annotate: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
item_id | str | ||
annotate_item_request | AnnotateItemRequest |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
202 | ACCEPTED | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
del_item
del_item(del_item_request)
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import items_api
from Hacarus.SpectroSdk.model.del_item_request import DelItemRequest
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = items_api.ItemsApi(api_client)
del_item_request = DelItemRequest(
item_ids=[
"item_ids_example",
],
) # DelItemRequest |
# example passing only required values which don't have defaults set
try:
api_instance.del_item(del_item_request)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->del_item: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
del_item_request | DelItemRequest |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_item_by_id
ItemWrapper get_item_by_id(item_id)
Get Item by Id
Get specific item and annotations
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import items_api
from Hacarus.SpectroSdk.model.item_wrapper import ItemWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = items_api.ItemsApi(api_client)
item_id = "item_id_example" # str |
show_assessments = True # bool | (optional)
show_annotations = True # bool | (optional)
model_id = "model_id_example" # str | (optional)
# example passing only required values which don't have defaults set
try:
# Get Item by Id
api_response = api_instance.get_item_by_id(item_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->get_item_by_id: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get Item by Id
api_response = api_instance.get_item_by_id(item_id, show_assessments=show_assessments, show_annotations=show_annotations, model_id=model_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->get_item_by_id: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
item_id | str | ||
show_assessments | bool | [optional] | |
show_annotations | bool | [optional] | |
model_id | str | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_items_by_type
GetItemsResponseWrapper get_items_by_type(item_type)
Get List of Items
Returns items based on given item_type
(prediction, training)
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import items_api
from Hacarus.SpectroSdk.model.get_items_response_wrapper import GetItemsResponseWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.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 Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = items_api.ItemsApi(api_client)
item_type = "item_type_example" # str |
count = 1 # int | (optional)
page = 1 # int | (optional)
model_id = "model_id_example" # str | (optional)
# example passing only required values which don't have defaults set
try:
# Get List of Items
api_response = api_instance.get_items_by_type(item_type)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->get_items_by_type: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get List of Items
api_response = api_instance.get_items_by_type(item_type, count=count, page=page, model_id=model_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling ItemsApi->get_items_by_type: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
item_type | str | ||
count | int | [optional] | |
page | int | [optional] | |
model_id | str | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]