Skip to content

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 )
ParameterTypeDescription
pageIndexInt?Index of page to load
sizeInt?Number of elements to load at once
sortStringsorting method. "REG_DT,DESC" = Sort by newest
timeZoneTimeZoneTime 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.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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.

   

BSA.JSONData.AuthHistoryData
NameTypeDescription
seqIntSequence.
userKeyStringUserID
clientKeyStringClient's unique key
clientNameStringClient name
statusBSA.Enums.AuthHistoryStatusStatus ( success = "CMMASC001", failed = "CMMASC002", canceled = "CMMASC003", timeout = "CMMASC004")
platformBSA.Enums.AuthPlatformPlatform (iOS = CMMAPF002)
contentStringContent.
connectIpStringAccess IP.
regDtStringAccess date. (Default, UTC +0)
regDt_koStringAccess date. (Korean format, Apply time zone option)
regDt_enStringAccess date. (English format, Apply time zone option)

BSA.JSONData.AuthHistoryPage
NameTypeDescription
firstBoolCheck if the current data is on the first page.
lastBoolCheck if the current data is on the last page.
currentPageIntCurrent page number.
pageSizeIntNumber of data entries per page.
totalElementsIntTotal number of data entries.
totalPagesIntTotal 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 )
ParameterTypeDescription
onSuccess([BSA.JSONData.LinkedSiteListData]) -> ()Callback called on success. It returns information about linked sites.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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.

   

BSA.JSONData.LinkedSiteListData
NameTypeDescription
seqIntSequence.
clientKeyStringClient's unique key
clientNameStringClient name
userStatusStringStatus (normal = "CMMMST001", wait = "CMMMST002", block = "CMMMST003", deleted = "CMMMST004", withdraw = "CMMMST005", reject = "CMMMST006", none = "")
clientExplainString?Site Description
siteUrlStringSite Address
interlockBoolLink Status
verifyTypeStringAuthentication 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 )
ParameterTypeDescription
clientNameStringSite name to search for.
onSuccess([BSA.JSONData.SiteListData]) -> ()Callback called on success. It returns an array of site information.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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.

   

BSA.JSONData.SiteListData
NameTypeDescription
seqIntSequence.
clientKeyStringClient's unique key
clientNameStringClient name
siteUrlStringSite Address
interlockBoolLink Status
verifyTypeStringAuthentication 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 )
ParameterTypeDescription
siteClientKeyStringClient's unique key of the site to authenticate.
siteIDStringAccount ID of the site to authenticate.
sitePasswordStringAccount password of the site to authenticate.
onSuccess(String) -> ()Callback called on success. It returns a Verification Token.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag variable to manage RxSwift Disposable objects.

Description

  • If the site you want to link has a verifyType value among the BSA.JSONData.SiteListData obtained from BSA.APICaller.retrieveSiteList, you need to confirm if the account is valid by calling BSA.APICaller.requestVerifySiteAccount with any value for the verifyType.
  • 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 )
ParameterTypeDescription
siteClientKeyStringClient's unique key of the site to link.
siteTokenStringToken obtained after account verification. If you do not perform account verification, use nil.
onSuccess(String) -> ()Called on success.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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 the siteToken.
  • If the site you want to link does not have a verifyType value, you can use nil for siteToken.

         

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 )
ParameterTypeDescription
siteClientKeyStringClient's unique key of the site to unlink.
onSuccess() -> ()Called on success.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag variable to manage RxSwift Disposable objects.

Description

  • This request will unlink the site matching siteClientKey.