Hi All,
I have a collection , which has media field. How can I pass value for that field in creational API?
Thanks,
Hi All,
I have a collection , which has media field. How can I pass value for that field in creational API?
Thanks,
import requests
url = ‘https://api.example.com/collections’
headers = {
‘Authorization’: ‘Bearer your_api_token’,
‘Content-Type’: ‘application/json’,
}
data = {
“field1”: “value1”,
“field2”: “value2”,
“media_field”: “https://example.com/path/to/media.jpg”
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 201:
print(“Item created successfully”)
else:
print(“Error:”, response.status_code, response.text)