Site
Site (/site)
Authorization
Site authorized only by userId and Token in HEADER
key: "SiteAuth"
value: "userID:Token"
curl --request POST -H "Content-Type=multipart/form-data" -H "SiteAuth:<userId>:<Token>" "$URL"
The following methods should be used to implement website functionality.
exportedListingIdList
URI | /exportedListingIdList |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | closedDays (integer) /* optional blockedDays (integer) /* optional |
Result | id, lastUpdated |
Description | Get full list listing in one request closedDays=5 - added to list listing on status closed when closing up to max 5 days back blockedDays=10 - added to list listing on status pending (blocked) when blocked up to max 10 days back Getting without parametr "closedDays" and "blockedDays", only active listings for company are returned |
listing
URI | /listing |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | id* (integer) |
Result | Listing object {
//all fields from /listingList plus
description: (string),
englishDescription: (string),
agent: {
id: (integer),
firstName: (string),
lastName: (string),
email: (string),
phoneNumber: (string),
skypeUser: (string),
imageId: (integer)
},
parentListing: {
id: (integer),
listingId: (string),
name: (string)
},
nestedListings :(array of objects {id:(integer), listingId:(integer)})
}
|
Description | Return details of listing. Currently only listings of section Investments can be parentListing. Listings of any type can be nestedListings. |
image
URI | |
|---|---|
HTTP method | GET |
Access scope | Public |
Parameters | id* (integer) |
Result | an image |
Description | Returns image for listing. |
listingFieldsMetadata
URI | /listingFieldsMetadata |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | |
Result | object - properties are names of section (Section dictionary) and values are arrays of object defining field in following format {
name:(string),
type:(dictionary FieldType),
//views that fields should occure in interface
views: (array of dictionary View)
//if type=dictionary or type=dictionaryList,
//array of possible dictionary values
values: (array of string),
//if type=dictionary or type=dictionaryListi18n message prefix
//(dictionaryMessageKey+'.'+value gives full key f.ex. taskStatus.Closed)
//it is dictionary name with first letter lowercase
dictionaryMessageKey: (string)
}
|| |
Description | Fields specific to listings from given section (HouseSale,LotRental etc.). {
ApartmentSale:[
name:'price',type:'money',views:['show','list'],
name:'noOfRooms',type:'integer':views:['show','list']
],
LotSale:[
...
],
...
}
|
customField/listFields
URI | /customField/listFields |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | |
Result | list of custom field |
Description | Get full list custom field |
company/getCompanyData
URI | /company/getCompanyData |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | |
Result | list of company settings |
Description | Get list of company settings |
i18nMessages
URI | /i18nMessages |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | locale* (string) |
Result | object, property name is key and value is translated message |
Description | Messages for fields from /listingFieldsMetadata |
provinceList
URI | /provinceList |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | Location object {
id: (integer),
name: (string)
}
|
Result | Provinces of company's listings |
Description |
createListing
URI | /createListing |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters |
Example params: section:ApartmentSale |
Result | ID of the new listing |
Description | sets up a customer and creates a new listing with Draft status |
createSeeker
URI | /createSeeker |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters |
Example params: section:ApartmentSale |
Result | ID of the new seeker |
Description | sets up a customer and creates a new seeker with Draft status |
customer/create
URI | /customer/create |
|---|---|
HTTP method | POST |
Access scope | Company |
Parameters | Example params: customerType:Person/Lead |
| Example | curl --location 'https://api.asari.pro/site/customer/create' \ --header 'Accept: application/json' \ --header 'SiteAuth: <UserID>:<TOKEN>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'customerType=Person' \ --data-urlencode 'firstName=Jan' \ --data-urlencode 'lastName=Kowalski' \ --data-urlencode 'customerFrom=Other' \ --data-urlencode 'phones%5B0%5D.phoneNumber=228307240' \ --data-urlencode 'emails%5B0%5D.email=example@asari.pl' \ --data-urlencode 'address.city=Warszawa' \ --data-urlencode 'address.fullStreet=Polna 30' \ --data-urlencode 'address.postalCode=00-001' |
Result | ID of the new customer |
Description |
user/list
URI | /user/list |
|---|---|
HTTP method | POST |
Parameters | Example params: active=1 |
Result | list of user |
Description |
user/get
URI | /user/get |
|---|---|
HTTP method | POST |
Parameters | id* (integer) |
Result | User object |
Description |