WebLinksModule

public class WebLinksModule

Provides Web Link management.

  • Get information about a specified web link.

    Declaration

    Swift

    public func get(
        webLinkId: String,
        fields: [String]? = nil,
        completion: @escaping Callback<WebLink>
    )

    Parameters

    webLinkId

    The ID of the web link on which to retrieve information.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    url

    The specified url to create the web link for.

    parentId

    The id of the folder item that the web link lives in.

    name

    Optional name value for the created web link. If no name value is specified, defaults to url.

    description

    Optional description value for the created web link.

    sharedLink

    Shared links provide direct, read-only access to files or folder on Box using a URL.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    webLinkId

    The id of the web link to update info for.

    url

    The new url for the web link to update to.

    parentId

    The id of the new parent folder to move the web link.

    name

    The new name for the web link to update to.

    description

    The new description for the web link to update to.

    sharedLink

    Shared links provide direct, read-only access to files or folder on Box using a URL.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    webLink

    The ID of the web link to delete.

    completion

    An 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

    webLinkId

    The ID of the web link

    completion

    Returns 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

    webLink

    The ID of the web link

    access

    The 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

    unsharedAt

    The date-time that this link will become disabled. This field can only be set by users with paid accounts

    password

    The password required to access the shared link. Set to .null to remove the password

    canDownload

    Whether the shared link allows downloads. Applies to any items in the folder

    completion

    Returns 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

    webLinkId

    The ID of the web link

    completion

    Returns an empty response or an error