Skip to content

Latest commit

 

History

History
410 lines (238 loc) · 9.78 KB

File metadata and controls

410 lines (238 loc) · 9.78 KB

Common Methods

Application configuration apis

Methods with example and description

searchApplication

Search Application

applicationClient.common.searchApplication(authorization: authorization, query: query) { (response, error) in
    // Use response
}
Argument Type Required Description
authorization String? no
query String? no Provide application name

Provide application name or domain url

Returned Response:

ApplicationResponse

Success

  Example:
{
  "application": {
    "website": {
      "enabled": true,
      "basepath": "/"
    },
    "cors": {
      "domains": []
    },
    "auth": {
      "enabled": true
    },
    "description": "test",
    "channel_type": "store",
    "cache_ttl": -1,
    "internal": false,
    "is_active": true,
    "mode": "live",
    "_id": "620b931ee7bfb11f910bf4a3",
    "company_id": 2,
    "name": "test",
    "owner": "5b9b98150df588546aaea6d2",
    "logo": {
      "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png"
    },
    "favicon": {
      "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png"
    },
    "banner": {
      "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/landscape-banner/original/D2fr98CUH-JioMart-Groceries.png"
    },
    "token": "tPQv0nc23",
    "tokens": [
      {
        "token": "tPQv0nc23",
        "created_at": "2022-02-15T11:48:46.909Z"
      }
    ],
    "domains": [
      {
        "verified": true,
        "is_primary": true,
        "is_shortlink": true,
        "_id": "620b931ee7bfb11f910bf4a4",
        "name": "qckvv5lhp.hostfynd.dev"
      }
    ],
    "redirections": [],
    "meta": [],
    "created_at": "2022-02-15T11:48:46.909Z",
    "modified_at": "2022-02-15T11:48:46.909Z",
    "__v": 0,
    "domain": {
      "verified": true,
      "is_primary": true,
      "is_shortlink": true,
      "_id": "620b931ee7bfb11f910bf4a4",
      "name": "qckvv5lhp.hostfynd.dev"
    },
    "id": "620b931ee7bfb11f910bf4a3"
  }
}

getLocations

Get countries, states, cities

applicationClient.common.getLocations(locationType: locationType, id: id) { (response, error) in
    // Use response
}
Argument Type Required Description
locationType String? no Provide location type to query on. Possible values : country, state, city
id String? no Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state.

Get countries, states, cities

Returned Response:

Locations

Success

  Example:

Schemas

Properties Type Nullable Description
application Application? yes

Properties Type Nullable Description
verified Bool? yes Indicates domain is verified or not. TXT and A records should propagate correctly.
isPrimary Bool? yes Indicates domain is primary or not. Primary domain is the default/main domain.
isShortlink Bool? yes Shortlink is present or not for the domain
id String? yes The unique identifier (24-digit Mongo Object ID) of the domain
name String? yes
isPredefined Bool? yes Domain is hosting domain or not

Properties Type Nullable Description
enabled Bool? yes Shows whether sales channel website URL is enabled or not
basepath String? yes Base path for the current sales channel website

Properties Type Nullable Description
domains [String]? yes

Properties Type Nullable Description
enabled Bool? yes Shows sales channel auth is enabled or not enabled.

Properties Type Nullable Description
redirectFrom String? yes Old domain URL of the sales channel
redirectTo String? yes New domain URL of the sales channel. Users will be automatically redirected from old domain to new domain.
type String? yes It shows domain redirection type. Permanent redirection is for long time period redirection, and temporary redirection for a short time period.

Properties Type Nullable Description
name String? yes Indicates the name of application meta
value String? yes Value related to application meta name

Properties Type Nullable Description
secureUrl String? yes Hosted URL of the image

Properties Type Nullable Description
website ApplicationWebsite? yes
cors ApplicationCors? yes
auth ApplicationAuth? yes
description String? yes It contains detailed information about the sales channel
channelType String? yes It indicates different channel types like store, website-and-mobile-apps. Default value is store.
cacheTtl Int? yes An integer value that specifies the number of seconds until the key expires
isInternal Bool? yes Indicates whether a sales channel is internal or not
isActive Bool? yes Indicates whether a sales channel is active or not active
id String? yes The unique identifier (24-digit Mongo Object ID) of the sales channel
name String? yes Name of the sales channel, e.g. Zenz Fashion
owner String? yes The unique identifier (24-digit Mongo Object ID) of owner who owns the application
companyId Int? yes Numeric ID allotted to a business account where the sales channel exists
token String? yes Randomly generated fixed-length string for sales channel. It is required and auto-generated.
redirections [ApplicationRedirections]? yes
meta [ApplicationMeta]? yes
createdAt String? yes ISO 8601 timestamp of sales channel creation
updatedAt String? yes ISO 8601 timestamp of sales channel updation
v Int? yes Version key for tracking revisions. Default value is zero.
banner SecureUrl? yes
logo SecureUrl? yes
favicon SecureUrl? yes
domains [Domain]? yes
appType String? yes It shows whether application is live or in development mode
mobileLogo SecureUrl? yes
domain Domain? yes

Properties Type Nullable Description
message String? yes Response message for not found

Properties Type Nullable Description
message String? yes Failure message (in a string format)

Properties Type Nullable Description
name String? yes
code String? yes

Properties Type Nullable Description
name String? yes
symbol String? yes
code String? yes

Properties Type Nullable Description
capital String? yes
currency String? yes
iso2 String? yes
iso3 String? yes
name String? yes
parent String? yes
phoneCode String? yes
type String? yes
uid Int? yes
v Int? yes
id String? yes
defaultCurrency LocationDefaultCurrency? yes
defaultLanguage LocationDefaultLanguage? yes
stateCode String? yes
countryCode String? yes
latitude String? yes
longitude String? yes

Properties Type Nullable Description
items [LocationCountry]? yes