I’m currently working on uploading posts to HivePress using both the WP API and the HivePress API.
However, I’ve encountered an issue updating post attributes through the HivePress API.
Specifically, I need to update the description of a listing.
Unfortunately, I’ve encountered a limitation where the description can’t exceed 10,240 characters. Here is the error message I received:
Failed to update HivePress attributes for post ID: 821. Response: {'error': {'code': 400, 'errors': [{'message': '"Description" can\'t be longer than 10,240 characters.'}]}}
Does anyone know why or how I might work around this limitation?
Why Use Both API’s?
I can’t figure out a way to update the attributes of the listing with the WP API using meta tags
so using the Hivepress API was a good solution
If you update listings via the WP REST API there will be no limitation, it’s set on HivePress plugin level. You can update listings via the posts endpoint of the REST API, listing is a custom “hp_listing” post type.
Yes, but the main issue I had was that I couldn’t figure out how to use the WP REST API to update my custom attributes using the Hivepress API. The process is simple.
Looks like this is the solution
The description is already being created by WP REST API
What I’m simply looking for is to update the attributes, by using the combination of the API’s I can overcome the issue that I had with custom attributes
This depends on the attributes, e.g. the listing description is the post_content field, a text attribute is stored as a post meta with hp_attributenamehere key.
Please describe a sample attribute, or you can send a screenshot of its settings, then I can suggest the exact meta key, but generally number/text-based attributes are stored as meta fields, while selectable attributes are stored as taxonomy terms.