Other APIs (Need for Access Token)
The following APIs require a valid Access Token obtained through authentication to be invoked successfully.
i. Authentication History Query
API : BSA.APICaller.retrieveAuthHistory
swift
BSA.APICaller.retrieveAuthHistory(pageIndex:0, size: 10,
onSuccess: { arrayData, pageData in
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.retrieveAuthHistory(
pageIndex: Int?,
size: Int?,
sort: String = "REG_DT,DESC",
timeZone: TimeZone = .autoupdatingCurrent,
onSuccess: @escaping ([BSA.JSONData.AuthHistoryData], BSA.JSONData.AuthHistoryPage) -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
pageIndex | Int? | Index of page to load |
size | Int? | Number of elements to load at once |
sort | String | sorting method. "REG_DT,DESC" = Sort by newest |
timeZone | TimeZone | Time zone settings. The default is the OS's time zone value. |
onSuccess | ([BSA.JSONData.AuthHistoryData], BSA.JSONData.AuthHistoryPage ) -> () | Callback called on success. It returns an array of authentication history data and page data. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- Information about authentication history is contained in
[BSA.JSONData.AuthHistoryData]
returned on success. BSA.JSONData.AuthHistoryPage
contains page information such as the maximum number of entries.
Related Data
BSA.JSONData.AuthHistoryData
Name | Type | Description |
---|---|---|
seq | Int | Sequence. |
userKey | String | UserID |
clientKey | String | Client's unique key |
clientName | String | Client name |
status | BSA.Enums.AuthHistoryStatus | Status ( success = "CMMASC001", failed = "CMMASC002", canceled = "CMMASC003", timeout = "CMMASC004") |
platform | BSA.Enums.AuthPlatform | Platform (iOS = CMMAPF002) |
content | String | Content. |
connectIp | String | Access IP. |
regDt | String | Access date. (Default, UTC +0) |
regDt_ko | String | Access date. (Korean format, Apply time zone option) |
regDt_en | String | Access date. (English format, Apply time zone option) |
BSA.JSONData.AuthHistoryPage
Name | Type | Description |
---|---|---|
first | Bool | Check if the current data is on the first page. |
last | Bool | Check if the current data is on the last page. |
currentPage | Int | Current page number. |
pageSize | Int | Number of data entries per page. |
totalElements | Int | Total number of data entries. |
totalPages | Int | Total number of pages calculated based on (pageSize). |
ii. Linked Site List Query
API : BSA.APICaller.retrieveLinkedSiteList
swift
BSA.APICaller.retrieveLinkedSiteList(onSuccess: { arrayData in
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.retrieveLinkedSiteList(
onSuccess: @escaping ([BSA.JSONData.LinkedSiteListData]) -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
onSuccess | ([BSA.JSONData.LinkedSiteListData] ) -> () | Callback called on success. It returns information about linked sites. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- Information about linked sites is contained in
[BSA.JSONData.LinkedSiteListData]
returned on success. - It retrieves the list of sites currently linked by the user.
Related Data
BSA.JSONData.LinkedSiteListData
Name | Type | Description |
---|---|---|
seq | Int | Sequence. |
clientKey | String | Client's unique key |
clientName | String | Client name |
userStatus | String | Status (normal = "CMMMST001", wait = "CMMMST002", block = "CMMMST003", deleted = "CMMMST004", withdraw = "CMMMST005", reject = "CMMMST006", none = "") |
clientExplain | String? | Site Description |
siteUrl | String | Site Address |
interlock | Bool | Link Status |
verifyType | String | Authentication Type (if there is a value, it requires an account for that site) |
iii. Complete Site List Query
API : BSA.APICaller.retrieveSiteList
swift
BSA.APICaller.retrieveSiteList(clientName: "",
onSuccess: { arrayData in
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.retrieveSiteList(
clientName: String?,
onSuccess: @escaping ([BSA.JSONData.SiteListData]) -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
clientName | String | Site name to search for. |
onSuccess | ([BSA.JSONData.SiteListData] ) -> () | Callback called on success. It returns an array of site information. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- Information about sites is contained in
[BSA.JSONData.SiteListData]
returned on success. - If you input a space ("") for the
clientName
parameter, it returns information about all sites. - It returns information about sites with site names containing the string you provided in the
clientName
parameter.
Related Data
BSA.JSONData.SiteListData
Name | Type | Description |
---|---|---|
seq | Int | Sequence. |
clientKey | String | Client's unique key |
clientName | String | Client name |
siteUrl | String | Site Address |
interlock | Bool | Link Status |
verifyType | String | Authentication Type (if there is a value, it requires an account for that site) |
iv. Site Account Authentication
API : BSA.APICaller.requestVerifySiteAccount
swift
BSA.APICaller.requestVerifySiteAccount(siteClientKey: siteClientKey,
siteID: siteID,
sitePassword: sitePassword,
onSuccess: { token in
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.requestVerifySiteAccount(siteClientKey: String,
siteID: String,
sitePassword: String,
onSuccess: @escaping (String) -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
siteClientKey | String | Client's unique key of the site to authenticate. |
siteID | String | Account ID of the site to authenticate. |
sitePassword | String | Account password of the site to authenticate. |
onSuccess | (String) -> () | Callback called on success. It returns a Verification Token. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- If the site you want to link has a
verifyType
value among theBSA.JSONData.SiteListData
obtained fromBSA.APICaller.retrieveSiteList
, you need to confirm if the account is valid by callingBSA.APICaller.requestVerifySiteAccount
with any value for theverifyType
. - If the account information for the site is valid and the callback is successful, you should proceed with
BSA.APICaller.requestLinkSite
using the Verification Token returned.
v. Site Linking Request
API : BSA.APICaller.requestLinkSite
swift
BSA.APICaller.requestLinkSite(siteClientKey: siteClientKey,
siteToken: siteToken,
onSuccess: {
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.requestLinkSite(siteClientKey: String,
siteToken: String?,
onSuccess: @escaping () -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
siteClientKey | String | Client's unique key of the site to link. |
siteToken | String | Token obtained after account verification. If you do not perform account verification, use nil. |
onSuccess | (String) -> () | Called on success. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- If the site you want to link has a
verifyType
value, you need to confirm the account for that site first.- You should first proceed with
BSA.APICaller.requestVerifySiteAccount
to obtain thesiteToken
.
- You should first proceed with
- If the site you want to link does not have a
verifyType
value, you can use nil forsiteToken
.
vi. Site Unlinking Request
API : BSA.APICaller.requestUnlinkSite
swift
BSA.APICaller.requestUnlinkSite(siteClientKey: siteClientKey,
onSuccess: {
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.requestUnlinkSite(siteClientKey: String,
onSuccess: @escaping () -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
siteClientKey | String | Client's unique key of the site to unlink. |
onSuccess | () -> () | Called on success. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- This request will unlink the site matching
siteClientKey
.