Larks API specification

Larks api offers you the ability to integrate your apps with larks API. You can query demographic locations such as Country, Provinces, Municipalities and Suburbs.

Address


Create Country division with an object


Create locations division based on geocoding. With this method you can provide a name of a registration webhook

POST /api/Address/CreateCountryDemographicDivision

Request

                 

Create Country division by geoloaction with webhook


Create a country division based on a particular object. You need to provide an object with a registered hookname and an optional responseId, and optionalId. The optional id is to be included with an enpoint. Example https://www.site.com/route?optionalparameter=optionalId

POST /api/Address/CreateDivisionsByGeolocation

                

Create Country division by geoloaction


Create a country division based on a particular geolocation.

POST /api/Address/CreateLocationByGeoposition
 {
   "lat":
   "lng":
 }

Category


Get All Categories


Returns all location categories, in a particular language. parameter has to be a language code en,pt,fr

GET /api/category?lang={parameter}

Response

            

Create category


Create a new category to be associated with a location.

POST /api/category

Request
{
  "designation":"Parks",
  "lng":"en"
}

Update a category


Create a new category to be associated with a location.

PATCH /api/category?categoryId=parameter

Request

            

City


Create City


Create a new city based on a object

POST /api/City

Request

               

Get city by Id


Get a city based on the Id of that city. The parameter is the id of the city currently registered in larks.

GET /api/city/city?cityId=parameter

Response

               

Get cities in a province


Returns all the cities in a province. The parameter is the province id.

GET /api/City/citiesinprovince?provinceId=parameter

Response

               

Get country cities


Returns all the cities in a spefic country. The parameter is the country id.

GET /api/City/citiesincountry?countryId=parameter

Response

               

Country


Get All Countries

Retrieve all countries in stored in LARKS

GET /api/countries/allcountries


            

Get country by country Id

Retrieves a single country by Id and it includes provinces and municipalities or districts or cities.

GET /api/countries?id=parameter


            

Get Country by given name

Retrieves a country and its provinces or states by the country given name.

GET /api/countries/countryByName?countryName=Country name


            

Districts


Create District


Create a new district based on a object, under a specific province

POST /api/district

Request

                

Get District


Returns a single district, based on a district id.

GET /api/district?districtId=parameter

Request

                

Get districts in a particular province.


Returns a list of districts that belong to a single province.

GET /api/district/districtsinprovice?provinceId=parameter

Request

                

Location


Create Location

Create a new location with images and a specific division. This end point expects a form-data, this is because you can create locations with images or videos

POST /api/newLocation

Request

                curl --location 'https://larks.africa/api/Location/newLocation' \
                --form 'designation="Mercedez Midrand"' \
                --form 'additionalInfo="Mercedez benz main seller in Midrand. "' \
                --form 'countryId="1"' \
                --form 'municipalityID="1"' \
                --form 'categoryId="1"' \
                --form 'suburbId="3"' \
                --form 'subCategories="4"' \
                --form 'subCategories="3"' \
                --form 'Files=' \
                --form 'cityId="3"' \
                --form 'lat="-25.973972"' \
                --form 'Lng="28.117133"'
                

Response

            

Get locations by Category


Retrieve list of locations with images and a specific divisions. This end point expects a form-data, this is because you can create locations with images or videos

GET /api/location/CategoryLocations?categoryid=parameter

Response

        

Location by distance


Retrieve a list of locations with images and divisions. This end point expects a geoposition and a distance in KM.

GET /api/location/locationbydistance?distance=1.0&pageNumber=1&pageSize=2&lat=-25.973419&lng=28.119508

Response

        

Location by distance and category


Retrieve a list of locations with images and divisions. This end point expects a form-data, this is because you can create locations with images or videos

GET /api/location/locationbydistanceandcategory?distance=1.0&category=2&pageNumber=1&pageSize=2&lat=-25.973419&lng=28.119508

Response

        

Locations in a particular city


Retrieve a list of locations with images and divisions. This end point returns a list of locations in a particular city.

GET /api/location/locationsincity?cityId={parameter}&pageNumber=1&pageSize=2

Response

            

Locations in a particular municipality


Retrieve a list of locations with images and divisions. This end point returns a list of locations in a particular municipality.

GET /api/location/locationsinmunicipality?municipalityId={parameter}&pageNumber=1&pageSize=2

Response

            

Media


Get Location Media

Return an image of if it exists in the larks filestore.

GET/api/media/locationimages?category=category&filename=filename

Response
                    image/jpeg
                

Municipalities



Create a new municipality.

Creates a new municipality under a specific province.

POST /api/Municipality

Request

                

Get Municipality

Returns a single municipality object.

GET/api/Municipality?muncipalityId=parameter

Response

            

Get municipalities .

Returns a list of municipalities in a specific province.

GET /api/Municipality/MunicipalitiesInProvince?provinceId=parameter

Response

            

Provinces



Create Province

Creates a new procince based on a specific object.

POST/api/Province

Response

                

Provinces in a country

Returns a list of provinces based on a particular country by name.

GET/api/province/ProvincesInCountry?countryname=parameter

Response

                

Provinces in a country

Returns a list of provinces based on a country id.

GET/api/province/CountryProvinces?CountryId=parameter

Response

                

Subcategories



Create a new subcategories.

Creates a new subcategories under a specific category.

POST/api/Subcategory

Request

                

Get subcategories by id.

Returns an object of a subcategory. Parameter represents subcategory id.

GET /api/Subcategory/SubcategoriesInCategory?categoryId=parameters

Response

                

Get subcategories under a specific category.

Returns a list of subcategories under a specific category. Parameter represents category id.

GET /api/subcategory/Subcategory?id=parameters

Response

                

Get all subcategories.

Returns a list of all the subcategories, under a specific language. The supported languages codes are en,pt,fr

GET /api/Subcategory/Allsubcategories?lang=paramenter

Response

                

Suburbs



Get suburbs by sector

Returns a list of all suburbs that under a specific sector, this sector can be district, municipality or city. The id parameter represents the id of provided sector

GET/api/suburb/sectorNeighbourhood?sector=municipality&id=

Response

                

Get a single suburb

Returns an object of a single suburb.

GET/api/suburb/Suburb?id=parameter

Response

                

Get a list of suburbs

Returns a list of suburbs based on the given list of id

GET/api/suburb/ListOfSuburb?suburbsQuery=2,3

Response

                

Get a list of suburbs by query parameter

Returns a list of suburbs based on the given list of id

GET/api/suburb/SuburbList?suburbList=2&suburbList=3

Response