I need to add pictures to ads via API
I’m trying this method Upload an attachment | HivePress REST API documentation
This is the right method?
I tried different things but got error.
responce: {‘error’: {‘code’: 400}}
or
{‘code’: ‘rest_invalid_json’,
‘data’: {‘status’: 400,
‘json_error_code’: 4,
‘json_error_message’: ‘Syntax error’}}
I tried to transmit file as image and as text (base64)
if I use /wp-json/wp/v2/media I can upload an image but it will not fit the size of the ad template
I tried other methods and it worked (/wp-json/hivepress/v1/listings/{listing_id})
I use python.
How can l use this method: post v1/attachments?
Thanks for the answer