Files
Riccardo Schirone d62adad4bc Update CRS/Competition API to v1.4.0 (-rc1 capi) (#880)
* Update competition-test-api to v1.4-rc1
* Update to competition/crs API v1.4.0
2025-06-18 16:51:52 +02:00

3.4 KiB

competition_api_client.FreeformApi

All URIs are relative to http://localhost

Method HTTP request Description
v1_task_task_id_freeform_post POST /v1/task/{task_id}/freeform/ Submit Freeform

v1_task_task_id_freeform_post

TypesFreeformResponse v1_task_task_id_freeform_post(task_id, payload)

Submit Freeform

CRSs may submit anything to this endpoint as a base64'd string. This is the only way to submit PoVs and Patches for unharnessed challenges, but will be open for other challenges also. Nothing submitted to this endpoint is evaluated automatically. Bundles can only contain one freeform_id, so pack as much info into the Freeform as you need.

Example

  • Basic Authentication (BasicAuth):
import competition_api_client
from buttercup.orchestrator.competition_api_client.models.types_freeform_response import TypesFreeformResponse
from buttercup.orchestrator.competition_api_client.models.types_freeform_submission import TypesFreeformSubmission
from buttercup.orchestrator.competition_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = competition_api_client.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: BasicAuth
configuration = competition_api_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with competition_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = competition_api_client.FreeformApi(api_client)
    task_id = 'task_id_example' # str | Task ID
    payload = competition_api_client.TypesFreeformSubmission() # TypesFreeformSubmission | Submission Body

    try:
        # Submit Freeform
        api_response = api_instance.v1_task_task_id_freeform_post(task_id, payload)
        print("The response of FreeformApi->v1_task_task_id_freeform_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FreeformApi->v1_task_task_id_freeform_post: %s\n" % e)

Parameters

Name Type Description Notes
task_id str Task ID
payload TypesFreeformSubmission Submission Body

Return type

TypesFreeformResponse

Authorization

BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

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