API kūrėjams
With the Seconda API you can post ads programmatically, without opening the website. Jums reikia API rakto iš paskyros.
1. Padarykite raktą
Raktai gaminami iš jūsų paskyros, adresu Nustatymai, API raktai.
Raktas rodomas tik vieną kartą, kuriant. Tada nukopijuokite ir saugokite; po to nebematysi.
2. Prisijunkite
Send the key with each request, in one of two headers:
Authorization: Bearer seconda_ab12cd34_...
# sau, la fel de bine:
X-API-Key: seconda_ab12cd34_...3. Sukurkite skelbimą
Siųskite skelbimo duomenis JSON formatu. The price is whole, in money (15000 means 150.00 lei). Privalomi: pavadinimas (5-80 simbolių), aprašymas (20-3000 simbolių), kategorija (kategorija-lapas) ir kaina (1-100 000 lėjų).
curl -X POST https://seconda.ro/api/v1/articole \
-H "Authorization: Bearer CHEIA_TA" \
-H "Content-Type: application/json" \
-d '{
"titlu": "Rochie de vara",
"descriere": "Rochie usoara din bumbac, purtata de doua ori, marimea M.",
"categorie": "femei-rochii",
"pret": 15000,
"moneda": "RON"
}'The response contains the ad id, which you need in the next steps.
4. Įkelkite paveikslėlius
Send the pictures as a multipart, with the "pictures" field repeated for each file. Between 1 and 20 pictures, in JPEG, PNG or WebP format.
curl -X POST https://seconda.ro/api/v1/articole/ID_ARTICOL/poze \
-H "Authorization: Bearer CHEIA_TA" \
-F "[email protected]" \
-F "[email protected]"5. Paskelbkite skelbimą
After you've added your photos, publish your ad to appear in the catalog.
curl -X POST https://seconda.ro/api/v1/articole/ID_ARTICOL/publica \
-H "Authorization: Bearer CHEIA_TA"Patvirtinimo el
When you post manually, from the site, you get a confirmation email for each ad. When you post through the API, with a key, you don't get an email with each ad, but a single summary at the end of the day.