BoxClient
public class BoxClient
Provides communication with Box APIs. Defines methods for communication with Box APIs
-
Provides File management.
Declaration
Swift
public private(set) lazy var files: FilesModule { get set } -
Provides Folder management.
Declaration
Swift
public private(set) lazy var folders: FoldersModule { get set } -
Provides User management.
Declaration
Swift
public private(set) lazy var users: UsersModule { get set } -
Provides Group management.
Declaration
Swift
public private(set) lazy var groups: GroupsModule { get set } -
Provides Comment management.
Declaration
Swift
public private(set) lazy var comments: CommentsModule { get set } -
Provides SharedItem management.
Declaration
Swift
public private(set) lazy var sharedItems: SharedItemsModule { get set } -
Web Links management.
Declaration
Swift
public private(set) lazy var webLinks: WebLinksModule { get set } -
Provides search functionality.
Declaration
Swift
public private(set) lazy var search: SearchModule { get set } -
Provides collections functionality.
Declaration
Swift
public private(set) lazy var collections: CollectionsModule { get set } -
Provides collaborations functionality.
Declaration
Swift
public private(set) lazy var collaborations: CollaborationsModule { get set } -
Provides collaborations whitelist functionality.
Declaration
Swift
public private(set) lazy var collaborationWhiteList: CollaborationWhitelistModule { get set } -
Metadata management.
Declaration
Swift
public private(set) lazy var metadata: MetadataModule { get set } -
Provides Events management.
Declaration
Swift
public private(set) lazy var events: EventsModule { get set } -
Metadata cascade policy.
Declaration
Swift
public private(set) lazy var metadataCascadePolicy: MetadataCascadePolicyModule { get set } -
Trash management.
Declaration
Swift
public private(set) lazy var trash: TrashModule { get set } -
Device Pin management.
Declaration
Swift
public private(set) lazy var devicePins: DevicePinsModule { get set } -
Recent Items management
Declaration
Swift
public private(set) lazy var recentItems: RecentItemsModule { get set } -
Webhooks management
Declaration
Swift
public private(set) lazy var webhooks: WebhooksModule { get set } -
Tasks management.
Declaration
Swift
public private(set) lazy var tasks: TasksModule { get set } -
Retention policy management.
Declaration
Swift
public private(set) lazy var retentionPolicy: RetentionPoliciesModule { get set } -
Provides TermsOfService
Declaration
Swift
public private(set) lazy var termsOfService: TermsOfServicesModule { get set } -
Legal Hold Policies management
Declaration
Swift
public private(set) lazy var legalHolds: LegalHoldsModule { get set } -
Storage Policies management
Declaration
Swift
public private(set) lazy var storagePolicies: StoragePoliciesModule { get set } -
Provides authentication session management.
Declaration
Swift
public private(set) var session: SessionProtocol -
Requests header.
Declaration
Swift
public private(set) var headers: BoxHTTPHeaders? -
SDK request configuration.
Declaration
Swift
public private(set) var configuration: BoxSDKConfiguration -
Indicates whether this BoxClient instance was already destroyed and should not be further used.
Declaration
Swift
public private(set) var isDestroyed: Bool -
ID of user’s favorites collection.
Declaration
Swift
public internal(set) var favoritesCollectionId: String? -
Initializer
Declaration
Swift
public init(networkAgent: NetworkAgentProtocol, session: SessionProtocol, configuration: BoxSDKConfiguration)Parameters
networkAgentProvides network communication with the Box APIs.
sessionProvides authentication session management.
configurationProvides parameters to makes API calls in order to tailor it to their application’s specific needs
-
Creates BoxClient instance based on shared link URL and password.
Declaration
Swift
public func withSharedLink(url: URL, password: String?) -> BoxClientParameters
urlShared link URL.
passwordShared link password.
Return Value
Returns new standard BoxClient object.
-
Creates BoxClient instance based on user identifier.
Declaration
Swift
public func asUser(withId userId: String) -> BoxClientParameters
userIdUser identifier.
Return Value
Returns new standard BoxCliennt object.
-
Destroys the client, revoking its access tokens and rendering it inoperable.
Declaration
Swift
public func destroy(completion: @escaping Callback<Void>)Parameters
completionCalled when the operation is complete.
-
Exchange the token.
Declaration
Swift
public func exchangeToken( scope: Set<TokenScope>, resource: String? = nil, completion: @escaping TokenInfoClosure )Parameters
scopeScope or scopes that you want to apply to the resulting token.
resourceFull url path to the file that the token should be generated for, eg: https://api.box.com/2.0/files/{file_id}
completionReturns the success or an error.
-
Performs an HTTP GET method call on an API endpoint and returns a response.
Declaration
Swift
public func get( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP POST method call on an API endpoint and returns a response.
Declaration
Swift
public func post( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], json: Any? = nil, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
jsonThe JSON body of the request
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP POST method call on an API endpoint and returns a response.
Declaration
Swift
public func post( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], multipartBody: MultipartForm, progress: @escaping (Progress) -> Void = { _ in }, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
multipartBodyThe multipart body of the request
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP PUT method call on an API endpoint and returns a response.
Declaration
Swift
public func put( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], json: Any? = nil, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
jsonThe JSON body of the request
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP PUT method call on an API endpoint and returns a response.
Declaration
Swift
public func put( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], multipartBody: MultipartForm, progress: @escaping (Progress) -> Void = { _ in }, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
multipartBodyThe multipart body of the request
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP PUT method call on an API endpoint and returns a response - variant for chunked upload.
Declaration
Swift
public func put( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], data: Data, progress: @escaping (Progress) -> Void = { _ in }, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
dataBinary body of the request
progressClosure where upload progress will be reported
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP OPTIONS method call on an API endpoint and returns a response.
Declaration
Swift
public func options( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], json: Any? = nil, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
jsonThe JSON body of the request
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP DELETE method call on an API endpoint and returns a response.
Declaration
Swift
public func delete( url: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
completionReturns a BoxResponse object or an error if request fails
-
Performs an HTTP GET method call for downloading on an API endpoint and returns a response.
Declaration
Swift
public func download( url: URL, downloadDestinationURL: URL, httpHeaders: BoxHTTPHeaders = [:], queryParameters: QueryParameters = [:], progress: @escaping (Progress) -> Void = { _ in }, completion: @escaping Callback<BoxResponse> )Parameters
urlThe URL of the API endpoint to call.
httpHeadersAdditional information to be passed in the HTTP headers of the request.
queryParametersAdditional parameters to be passed in the URL that is called.
downloadDestinationURLThe URL on disk where the data will be saved
progressCompletion block to track the progress of the request
completionReturns a BoxResponse object or an error if request fails
BoxClient Class Reference