This is a code that I wrote by taking references from many sites:
import requests
headers = {
'Content-Type': 'application/json',
'kbn-version': '8.4.1'
}
data = {
"options": {
"query": {
"bool": {
"filter": [
{
"match": {
"topic": "rajamouli"
}
}
]
}
}
}
}
filter_id = "1663536927031"
response = requests.put(f'https://social-media-analyzer.kb.ap-south-1.aws.elastic-cloud.com:9243/s/testspace/api/input_controls/control/{filter_id}', headers=headers, json=data, auth=('username', 'password'))
print(response.json())
But it is showing this error:
{'statusCode': 404, 'error': 'Not Found', 'message': 'Not Found'}
Please someone help me out here.