Generate a listing poster through the AgentOS API
Use the AgentOS API to submit a listing poster job, check its status, and download the finished image.
On this page
Get the key and template Submit the job Check status and download Continue a submissionGet the key and template
Get your AgentOS API key in Settings → API Key. Keep it in your environment and have your listing details and poster template ready.
Submit the job
List templates and get the one you want. Fill the required fields from its body.inputSchema in the inputs object. Save the request as request.json.
{
"action": "start",
"medium": "poster",
"templateId": "TEMPLATE_ID",
"inputs": {},
"requestKey": "listing-SOURCE_ID-poster-v1"
}Run the commands below in order and save the returned operation.operationId and your request key. HTTP 202 means the job was accepted.
# Bash / WSL. Set AGENTOS_API_KEY privately in your environment first.
curl --fail-with-body -H "Authorization: Bearer $AGENTOS_API_KEY" \
"https://api.bsquarerealty.com/v1/workflow-api/media/templates?medium=poster"
curl --fail-with-body -H "Authorization: Bearer $AGENTOS_API_KEY" \
"https://api.bsquarerealty.com/v1/workflow-api/media/templates/TEMPLATE_ID?medium=poster"
curl --fail-with-body -X POST \
-H "Authorization: Bearer $AGENTOS_API_KEY" -H "Content-Type: application/json" \
--data-binary @request.json \
"https://api.bsquarerealty.com/v1/workflow-api/media/generate"
# Run only after saving the returned operation.operationId.
curl --fail-with-body -H "Authorization: Bearer $AGENTOS_API_KEY" \
"https://api.bsquarerealty.com/v1/workflow-api/media/operations/OPERATION_ID?medium=poster"- GET templateRead the selected template’s required input fields.
- POST generationHTTP 202 returns an operation ID. Save it with the request key.
- GET operationWhen status is succeeded, read the image URL in artifacts and open the file.
Check status and download
Read the saved operation until it finishes. When status is succeeded, open the image URL in operation.artifacts and download it.
Continue a submission
Poll on a fixed interval (for example, every 5 seconds) and follow Retry-After if you receive HTTP 429. To retry a timed-out submission, use the same request key and body. Use a new key for a new version.
