You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Dzeranov, it seems that it's a problem in our documentation, we will fix it. But you can create webhook without specifying org_id with the following script
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.model.webhook_read import WebhookRead
from cvat_sdk.api_client.model.webhook_write_request import WebhookWriteRequest
from pprint import pprint
configuration = Configuration(
host = "<your_host>",
username = '<username>',
password = '<password>',
)
with ApiClient(configuration) as api_client:
webhook_write_request = WebhookWriteRequest(
target_url="http://examples.com",
description="description_example",
type="project",
content_type="application/json",
secret="secret_example",
is_active=True,
enable_ssl=True,
project_id=1,
events=[
"create:comment",
],
)
try:
(data, response) = api_client.webhooks_api.create(webhook_write_request)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling WebhooksApi.webhooks_create: %s\n" % e)
My actions before raising this issue
Steps to Reproduce (for bugs)
Follow this example: https://opencv.github.io/cvat/docs/api_sdk/sdk/reference/apis/webhooks-api/#create
but without setting
org_id
field.Expected Behaviour
No errors.
Current Behaviour
Invalid type for variable 'organization'. Required value type is int and passed type was NoneType at ['received_data']['organization']
Possible Solution
https://opencv.github.io/cvat/docs/api_sdk/sdk/reference/apis/webhooks-api/#create
https://opencv.github.io/cvat/docs/api_sdk/sdk/reference/models/webhook-read/
Despite the fact that
org_id
andorganization
fields are optional (and possible types areint
andnone_type
) SDK is throwing error described above. Probably, the problem is with the API schema.Your Environment
docker version
: 20.10.22The text was updated successfully, but these errors were encountered: