AthausDoku

Create a project

Aufruf, Parameter, Antwort und Fehler von POST /v1/projects.

Zuletzt aktualisiert:

Creates a new-build project. The body is the OpenImmo 2.0 project; the headline in data.texts is its name. metadata.source.offererMarketingKey must be unique among the projects of the office (409 reference_already_exists). status is ours: the name of one of the office's project states; without it the project starts in the first. Send Idempotency-Key to make a retry safe. Needs write access to projects.

Braucht den Scope propose und mindestens die Stufe write auf projects.

Aufruf

POST https://api.athaus.ai/v1/projects

Parameter

Kopf

NameTypPflichtBeschreibung
Athaus-VersionstringneinOptional and carries nothing a client needs: the version is the path. Accepted when it says v1 or 1. Any other value is a 400 api_version_unsupported.
Idempotency-KeystringneinMakes a retry safe: the same key with the same body returns the first answer and writes nothing twice. A random value of at least 128 bits, for example a UUID, 1 to 255 characters. The key is kept for 24 hours and scoped to the API key and this operation. The same key with a different body is a 422; while the first request still runs it is a 409. Only successful answers are kept: after an error the key is free again.

Rumpf

JSON mit Content-Type: application/json. Ein Feld, das die API nicht kennt, ist ein 400, und errors[].name nennt das Feld. Der Rumpf ist Pflicht.

FeldTypBeschreibung
dataobject
data.estateTypestringEines von NEW_BUILD_PROJECT, NEW_HOME_PROJECT.
data.estateSubTypestring | object | null | any
data.distributionTypestringEines von BUY, RENT, BUY_RENT.
data.unitsobject
data.units.numberOfUnitsnumber0 bis 999999.
data.units.priceFromnumber0 bis .
data.units.priceTonumber0 bis .
data.units.livingSpaceFromnumber0 bis .
data.units.livingSpaceTonumber0 bis .
data.units.numberOfRoomsFromnumber0 bis .
data.units.numberOfRoomsTonumber0 bis .
data.units.furnishingLevelstringEines von NOT_PROVIDED, STANDARD, UPSCALE, FULL.
data.units.provisionTypestringEines von PROVISION_FREE, PROVISION_FOR_BUYER, NOT_PROVIDED.
data.units.provisionPercentnumber0 bis .
data.units.provisionIsVatIncludedstringEines von YES, NO, NOT_PROVIDED.
data.units.soldOutPercentagenumber0 bis .
data.locationobject
data.location.postalcodestring
data.location.citystring
data.location.streetstring
data.location.houseNumberstring
data.location.unitstring
data.location.staircasestring
data.location.floorNumberinteger-5 bis 999.
data.location.entrancestring
data.location.statestring
data.location.countrystringEine von 249 Angaben der Liste im Standard.
data.location.geometryobject
data.location.geometry.typestringImmer Point.
data.location.geometry.coordinatesnumber[]
data.location.showAddressbooleanVorgabe true.
data.location.locationNotemap<string>
data.programobject
data.program.projectStatusstringEines von CONSTRUCTION_START, PROJECT_ENDED.
data.deliveryDatestring
data.structureobject
data.structure.buildingobject
data.structure.building.numberOfFloorsinteger1 bis 999.
data.textsobject
data.texts.headlinemap<string>
data.texts.descriptionmap<string>
data.texts.featuresmap<string>
data.texts.extendedInformationmap<string>
data.texts.areamap<string>
data.linksobject
data.links.externalLinksobject[]
data.links.externalLinks[].urlstring
data.links.externalLinks[].urlTypestringEines von MAP, MOVIE, PANORAMA, REVOCATION_INSTRUCTION, OFFERER_DETAIL_PAGE.
data.links.externalLinks[].titlestring
data.links.virtualToursobject[]
data.links.virtualTours[].urlstring
data.links.virtualTours[].providerstring
data.links.virtualTours[].titlestring
data.contactobject
data.contact.salutationstringEines von Mr, Mrs, Miss, Ms, Mx, Sir, Dame, Dr, Cllr, Lady, Lord.
data.contact.firstNamestring
data.contact.lastNamestring
data.contact.namestring
data.contact.emailAddressstring
data.contact.phoneNumberstring
data.contact.mobilePhoneNumberstring
data.contact.imageURLstring
data.contact.userHomepagestring
data.contact.postalCodestring
data.contact.citystring
data.contact.streetstring
data.contact.houseNumberstring
data.contact.countrystring
data.contact.preferredContactTypestringEines von ANONYMOUS, BY_PHONE, BY_EMAIL, OWN_WEBSITE.
data.contact.contactNotemap<string>
data.contact.displayedInformationobject
data.contact.displayedInformation.mainContactPersonobject
data.contact.displayedInformation.additionalContactPersonobject
metadataobject
metadata.sourceobject
metadata.source.offererMarketingKeystring
metadata.source.offererEstateIdstring
metadata.portalWebKeystring
statusstringOurs, not OpenImmo: the name of one of the office's project states, for example Sales. Without it a new project starts in the first state of the office.

Beispiel

curl -X POST "https://api.athaus.ai/v1/projects" \
  -H "Authorization: Bearer ath_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"data":{"estateType":"NEW_BUILD_PROJECT","estateSubType":null,"distributionType":"BUY","units":{"provisionType":"PROVISION_FREE"},"location":{"postalcode":"04107","city":"Leipzig","street":"Kantstrasse","houseNumber":"37","country":"DEU","geometry":{"type":"Point","coordinates":[12.3731,51.3397]}},"texts":{"headline":{"de":"Waldstadt Suites"},"description":{"de":"Dreißig Wohnungen am Park."}}},"metadata":{"source":{"offererEstateId":"PRJ-7","offererMarketingKey":"PRJ-7"}},"status":"Vertrieb"}'

Antwort

Bei Erfolg kommt 202 mit ProjectReceipt.

ProjectReceipt

FeldTypBeschreibung
requestIdstring
projectIdstring
externalProjectIdstring
warningsobject[]
warnings[].typestring
warnings[].messagestring

Köpfe der Antwort

KopfBeschreibung
Request-IdIdentifies this request. Quote it in a support request.
Athaus-VersionThe API version of this response: v1.
Athaus-ReleaseThe release of v1 that answered, for example 1.0. A label for support and changelogs; no request can select it.
RateLimit-PolicyThe quota policy of the bucket that applies.
RateLimitRemaining quota and seconds until the bucket is full again.
Idempotent-Replayedtrue when this is the stored answer to an earlier request with the same Idempotency-Key.

Fehler

Jeder Fehler kommt als Problem Details. Verzweige auf code, nicht auf title oder detail.

StatusCodesBedeutung
400api_version_unsupported, invalid_bodyInvalid request.
401unauthorizedMissing or invalid API key.
403insufficient_permissions, plan_requiredThe key lacks a right, or the plan does not include API access.
404not_foundNothing under this ID.
409The request conflicts with the state of the resource (for example a duplicate), or with an idempotency key.
413payload_too_largeThe request body is larger than 512 KB.
415invalid_inputThe request body is not JSON. Send Content-Type: application/json.
422idempotency_key_reusedThe idempotency key was already used with a different request body.
429rate_limitedRate limit exceeded.
500internal_errorServer error.

Weiter lesen

Auf dieser Seite