WebLinksModule
public class WebLinksModule
Provides Web Link management.
-
Get information about a specified web link.
Declaration
Parameters
webLinkIdThe ID of the web link on which to retrieve information.
fieldsComma-separated list of fields to include in the response.
completionReturns a full web link object or an error.
-
Creates a new web link with the specified url on the specified item.
Declaration
Swift
public func create( url: String, parentId: String, name: String? = nil, description: String? = nil, sharedLink: NullableParameter<SharedLinkData>? = nil, fields: [String]? = nil, completion: @escaping Callback<WebLink> )Parameters
urlThe specified url to create the web link for.
parentIdThe id of the folder item that the web link lives in.
nameOptional name value for the created web link. If no name value is specified, defaults to url.
descriptionOptional description value for the created web link.
sharedLinkShared links provide direct, read-only access to files or folder on Box using a URL.
fieldsComma-separated list of fields to include in the response.
completionReturns a full web link object or an error.
-
Update the specified web link info.
Declaration
Swift
public func update( webLinkId: String, url: String? = nil, parentId: String? = nil, name: String? = nil, description: String? = nil, sharedLink: NullableParameter<SharedLinkData>? = nil, fields: [String]? = nil, completion: @escaping Callback<WebLink> )Parameters
webLinkIdThe id of the web link to update info for.
urlThe new url for the web link to update to.
parentIdThe id of the new parent folder to move the web link.
nameThe new name for the web link to update to.
descriptionThe new description for the web link to update to.
sharedLinkShared links provide direct, read-only access to files or folder on Box using a URL.
fieldsComma-separated list of fields to include in the response.
completionReturns the updated web link object or an error.
-
Delete a specified web link.
Declaration
Swift
public func delete( webLinkId: String, completion: @escaping Callback<Void> )Parameters
webLinkThe ID of the web link to delete.
completionAn empty response will be returned upon successful deletion.
-
Gets web link with updated shared link
Declaration
Swift
public func getSharedLink( forWebLink webLinkId: String, completion: @escaping Callback<SharedLink> )Parameters
webLinkIdThe ID of the web link
completionReturns a standard shared link object or an error
-
Creates or updates shared link for a web link
Declaration
Swift
public func setSharedLink( forWebLink webLinkId: String, access: SharedLinkAccess? = nil, unsharedAt: NullableParameter<Date>? = nil, password: NullableParameter<String>? = nil, canDownload: Bool? = nil, completion: @escaping Callback<SharedLink> )Parameters
webLinkThe ID of the web link
accessThe level of access. If you omit this field then the access level will be set to the default access level specified by the enterprise admin
unsharedAtThe date-time that this link will become disabled. This field can only be set by users with paid accounts
passwordThe password required to access the shared link. Set to .null to remove the password
canDownloadWhether the shared link allows downloads. Applies to any items in the folder
completionReturns a standard SharedLink object or an error
-
Removes shared link for a web link
Declaration
Swift
public func deleteSharedLink( forWebLink webLinkId: String, completion: @escaping Callback<Void> )Parameters
webLinkIdThe ID of the web link
completionReturns an empty response or an error
WebLinksModule Class Reference