Alipay+ Super App PlatformAlipay+ Super App Platform

pullSpaceContent

Use the pullSpaceContent API to retrieve the contents of specified spaces based on given input parameters.

Method signature

The following code shows the method signature of the pullSpaceContent API:

copy
public func pullSpaceContent(_ input: SpacePullInfo, completion: (Result<SpaceContent?, PullSpaceContentsError>) -> Void)

Request parameters

Name

Type

Description

input

SpacePullInfo

AnSpacePullInfoobject containing information about the requested space, including its code, pagination info, and any conditions or extended info.

completion

Result<SpaceContent, PullSpaceContentsError>)->Void

A closure that takes a Result containing either a SpaceContent object on success or a PullSpaceContentsError on failure.

The Result type helps to concisely represent success or failure without the need for separate error handling.

Response parameters

N/A

Exception

Error Code

Error message

1200

A network error has occurred.

1201

A backend error has occurred.

1202

The user ID is empty.

1203

A response payload is unavailable.

Sample

Swift

copy
var spacePullInfo = SpacePullInfo(spaceCode: "SPACE_CODE_001")
spacePullInfo.pullOffsetInfo = PullOffsetInfo(overallOffset: 0, pullSize: 10)
spacePullInfo.conditions = ["longtitude": "23.1234", "langtitude": "100.4567"]
ComponentManager.ASAP.businessComponent.pullSpaceContent(spacePullInfo)
{ result in
     switch result {
         case .success(let success):
         print(success)
         case .failure(let failure):
         print(failure)
     }
}