Integrazu Publishing Jobs

Start Publishing Job

Start vehicle publishing workflow(s) - supports multiple brands.

Creates one job per brand. Each brand has its own Integrazu token and location, so each requires a separate advert creation and publishing flow.

Request Format:

{
    "vehicle_id": 1234,
    "brands": [
        {"brand_id": 5, "platforms": ["standvirtual", "olx"], "location_id": "539"},
        {"brand_id": 8, "platforms": ["carmine"], "location_id": "742"}
    ],
    "advert_data": { ... },
    "image_urls": ["https://..."]
}

Setup:

  • Use GET /api/integrazu/data/brands-platforms to get brands with their location_ids and available platforms

Workflow (per brand):

  • "A criar anuncio"
  • "A carregar imagens" (if image_urls provided)
  • "A publicar em {Platform}" (for each platform)

Error Handling:

  • Each brand's job is independent - if one fails, others continue
  • Within a job: if advert creation fails, that job fails
  • If image upload fails: continues with publishing
  • If a portal fails: continues with remaining portals

Polling: Use GET /api/integrazu/publish/{job_id} for each job_id returned

post/api/integrazu/publish/start

Headers

x-api-tokenstring nullable

Request body

vehicle_idinteger required

Viatura.ID - the vehicle to publish

pv_idinteger required

PontosDeVenda.ID - the point of sale (used for token lookup and ViaturasEasyDataGreen)

listing_idinteger nullable

ViaturasEasyDataGreen.ID - if provided, uses existing listing instead of creating new one

image_urlsstring[] nullable

List of image URLs to upload. If not provided, uses photos from LocalizacaoFotos table.

Example request

{
  "brands": [
    {
      "brand_id": 5,
      "platforms": [
        "standvirtual",
        "olx"
      ],
      "renew": true,
      "website_ids": [
        1,
        2
      ]
    },
    {
      "brand_id": 8,
      "platforms": [
        "carmine",
        "autosapo_v2"
      ],
      "renew": false,
      "website_ids": [
        3
      ]
    }
  ],
  "image_urls": [
    "https://s3.../vehicle1.jpg",
    "https://s3.../vehicle2.jpg"
  ],
  "listing_data": {
    "color_id": 2,
    "doors_id": 5,
    "engine_capacity": 1197,
    "engine_power": 116,
    "fuel_id": 16,
    "license_plate": "AA-00-BB",
    "make_id": 51,
    "mileage": 35000,
    "model_id": 2018,
    "month": 6,
    "observations": "Viatura em excelente estado.",
    "price": 19500,
    "seats_id": 89,
    "state_id": 1,
    "traction": 2,
    "transmission_id": 1,
    "type_id": 8,
    "version_id": 86701,
    "warranty_id": 0,
    "year": 2020
  },
  "pv_id": 10,
  "vehicle_id": 1234
}

Response

Successful Response

total_jobsinteger required
messagestring required

Example response

{
  "jobs": [
    {
      "brand_id": 5,
      "brand_name": "Stand ABC",
      "job_id": 123,
      "platforms": [
        "standvirtual",
        "olx"
      ],
      "status": "pending"
    },
    {
      "brand_id": 8,
      "brand_name": "Stand XYZ",
      "job_id": 124,
      "platforms": [
        "carmine"
      ],
      "status": "pending"
    }
  ],
  "message": "2 publicacoes iniciadas. Use os job_ids para verificar o progresso.",
  "total_jobs": 2
}

Changes