util/requests.py
def create_box(box_json, observation_uuid: str, to_concept: Optional[str] = None):
    """
    Creates an association for a box in VARS
    :param box_json: JSON of bounding box data
    :param observation_uuid: Observation UUID
    :param to_concept: Optional concept part
    :return: HTTP response JSON if success, else None
    """
    request_data = {
        'observation_uuid': observation_uuid,
        'link_name': 'bounding box',
        'link_value': json.dumps(box_json),
        'mime_type': 'application/json'
    }

    if to_concept is not None:
        request_data['to_concept'] = to_concept

    token = check_auth()

    response = requests.post(
        util.utils.get_property('endpoints', 'assoc'),
        data=request_data,
        headers={
            'Authorization': 'BEARER {}'.format(token)
        }
    )
    return response.json()

    Creates an association for a box in VARS
    :param box_json: JSON of bounding box data
    :param observation_uuid: Observation UUID
    :param to_concept: Optional concept part
    :return: HTTP response JSON if success, else None
    
Creates an association for a box in VARS
Creates an association for a box in VARS
def create_box(box_json, observation_uuid: str, to_concept: Optional[str] = None):
    request_data = {
        'observation_uuid': observation_uuid,
        'link_name': 'bounding box',
        'link_value': json.dumps(box_json),
        'mime_type': 'application/json'
    }
    if to_concept is not None:
        request_data['to_concept'] = to_concept
    token = check_auth()
    response = requests.post(
        util.utils.get_property('endpoints', 'assoc'),
        data=request_data,
        headers={
            'Authorization': 'BEARER {}'.format(token)
        }
    )
    return response.json()
def create_box ( box_json , observation_uuid : str , to_concept : Optional [ str ] = None ) : request_data = { 'observation_uuid' : observation_uuid , 'link_name' : 'bounding box' , 'link_value' : json . dumps ( box_json ) , 'mime_type' : 'application/json' } if to_concept is not None : request_data [ 'to_concept' ] = to_concept token = check_auth ( ) response = requests . post ( util . utils . get_property ( 'endpoints' , 'assoc' ) , data = request_data , headers = { 'Authorization' : 'BEARER {}' . format ( token ) } ) return response . json ( )
Creates an association for a box in VARS
Creates an association for a box in VARS
"""
    Creates an association for a box in VARS
    :param box_json: JSON of bounding box data
    :param observation_uuid: Observation UUID
    :param to_concept: Optional concept part
    :return: HTTP response JSON if success, else None
    """
HTTP response JSON if success, else None
HTTP response JSON if success else None
box_json
JSON of bounding box data
JSON of bounding box data
observation_uuid
str
None
to_concept
Optional[str]
Optional concept part
Optional concept part