Search broken links in remote range Excel API : SearchBrokenLinksInRemoteRange
Search broken links in the range of remoted spreadsheet.
Interface Details
Endpoint
Copy PUT http://api.aspose.cloud/v4.0/cells/ {name}/worksheets/ {worksheet}/ranges/ {cellArea}search/broken-links
Function Description
This method searches for broken links within a range of spreadsheet file stored in remote cloud storage.It scans all sheets and cells to identify hyperlinks that no longer point to valid destinations, such as dead URLs or missing external references.The operation is performed remotely within the cloud environment, without requiring the file to be downloaded to the local machine.Ensure that you have valid cloud storage credentials and proper access permissions to the target file.If the source file cannot be accessed, if it contains unsupported formats, or if an error occurs during the scanning process, an appropriate exception will be thrown.Depending on the implementation, the method may return a list of broken links with details such as sheet name, cell coordinates, and the invalid URL.Users should carefully review the results to update or remove outdated links in the spreadsheet.
The request parameters of searchBrokenLinksInRemoteRange API are:
Parameter Name
Type
Path/Query String/HTTPBody
Description
name
String
Path
The name of the workbook file to be search.
worksheet
String
Path
Specify the worksheet for the lookup.
cellArea
String
Path
Specify the cell area for the lookup
folder
String
Query
The folder path where the workbook is stored.
storageName
String
Query
(Optional) The name of the storage if using custom cloud storage. Use default storage if omitted.
regoin
String
Query
The spreadsheet region setting.
password
String
Query
The password for opening spreadsheet file.
Response Description
Copy {
"Name" : "BrokenLinksReponse" ,
"Type" : "Class" ,
"ParentName" : "CellsCloudResponse" ,
"IsAbstract" : false ,
"Properties" : [
{
"Name" : "BrokenLinks" ,
"Nullable" : true ,
"ReadOnly" : false ,
"IsInherit" : false ,
"DataType" : {
"Identifier" : "Container" ,
"Reference" : "BrokenLink" ,
"ElementDataType" : {
"Identifier" : "Class" ,
"Reference" : "BrokenLink" ,
"Name" : "class:brokenlink"
},
"Name" : "container"
}
},
{
"Name" : "Code" ,
"Nullable" : true ,
"ReadOnly" : false ,
"IsInherit" : true ,
"DataType" : {
"Identifier" : "Integer" ,
"Name" : "integer"
}
},
{
"Name" : "Status" ,
"Nullable" : true ,
"ReadOnly" : false ,
"IsInherit" : true ,
"DataType" : {
"Identifier" : "String" ,
"Name" : "string"
}
}
]
}
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
Excel API SDK
Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Model;
using Aspose.Cells.Cloud.SDK.Request;
using System;
using System.IO;
using System.Collections.Generic;
using Range = Aspose.Cells.Cloud.SDK.Model.Range;
public static class Example40_SearchBrokenLinksInRemoteRange
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string remoteFolder = "TestData/In";
string bookFormulaXlsx = "BookFormula.xlsx";
var request = new SearchBrokenLinksInRemoteRangeRequest(
name: bookFormulaXlsx,
worksheet: "Sheet1",
cellArea: "A1:F40",
folder: remoteFolder
);
cellsApi.SearchBrokenLinksInRemoteRange(request);
}
}
Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class ExampleSearchBrokenLinksInRemoteRange {
private CellsApi api;
public ExampleSearchBrokenLinksInRemoteRange(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String remoteFolder = "TestData/In";
String bookFormulaXlsx = "BookFormula.xlsx";
UploadFileRequest uploadFileRequest = new UploadFileRequest();
uploadFileRequest.setPath( remoteFolder + "/" + bookFormulaXlsx );
uploadFileRequest.setStorageName( "");
HashMap<String,File> files = new HashMap<String,File>();
files.put( bookFormulaXlsx , new File(bookFormulaXlsx ));
uploadFileRequest.setUploadFiles(files);
cellsApi.uploadFile(uploadFileRequest);
SearchBrokenLinksInRemoteRangeRequest request = new SearchBrokenLinksInRemoteRangeRequest();
request.setName(bookFormulaXlsx);
request.setWorksheet("Sheet1");
request.setCellArea("A1:F40");
request.setFolder(remoteFolder);
this.api.searchBrokenLinksInRemoteRange(request);
} catch (ApiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php
require_once('vendor\autoload.php');
use \Aspose\Cells\Cloud\Api\CellsApi;
use \Aspose\Cells\Cloud\Request\SearchBrokenLinksInRemoteRangeRequest;
$cellsApi = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl"));
$remoteFolder = "TestData/In";
$bookFormulaXlsx = "BookFormula.xlsx";
CellsApiTestBase::ready( $this->instance,$bookFormulaXlsx ,$remoteFolder . "/" . $bookFormulaXlsx , "");
$request = new SearchBrokenLinksInRemoteRangeRequest();
$request->setName( $bookFormulaXlsx);
$request->setWorksheet( "Sheet1");
$request->setCellArea( "A1:F40");
$request->setFolder( $remoteFolder);
$$cellsApi->searchBrokenLinksInRemoteRange($request);
Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl'
require 'bundler'
require 'aspose_cells_cloud'
@instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
remote_folder = 'TestData/In'
book_formula_xlsx = 'BookFormula.xlsx'
mapFiles = { }
mapFiles[book_formula_xlsx] = ::File.open(File.expand_path("TestData/"+book_formula_xlsx),"r")
uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
@instance.upload_file(uploadrequest)
request = AsposeCellsCloud::SearchBrokenLinksInRemoteRangeRequest.new(:name=>book_formula_xlsx,:worksheet=>'Sheet1',:cellArea=>'A1:F40',:folder=>remote_folder);
@instance.search_broken_links_in_remote_range(request);
Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs');
var path = require('path');
const _ = require('asposecellscloud');
const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret,"v3.0",process.env.CellsCloudApiBaseUrl);
var remoteFolder = "TestData/In"
var bookFormulaXlsx = "BookFormula.xlsx"
var bookFormulaXlsxRequest = new model.UploadFileRequest();
bookFormulaXlsxRequest.uploadFiles ={bookFormulaXlsx:fs.createReadStream(localPath + bookFormulaXlsx)};
bookFormulaXlsxRequest.path = remoteFolder + "/" + bookFormulaXlsx ;
bookFormulaXlsxRequest.storageName ="";
cellsApi.uploadFile(bookFormulaXlsxRequest );
var request = new model.SearchBrokenLinksInRemoteRangeRequest();
request.name = bookFormulaXlsx;
request.worksheet = "Sheet1";
request.cellArea = "A1:F40";
request.folder = remoteFolder;
return cellsApi.searchBrokenLinksInRemoteRange(request).then((result) => {
expect(result.response.statusCode).to.equal(200);
});
Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
remote_folder = 'TestData/In'
book_formula_xlsx = 'BookFormula.xlsx'
mapFiles = {
local_name: local_name
}
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
api.upload_file(request)
request = SearchBrokenLinksInRemoteRangeRequest( book_formula_xlsx, 'Sheet1', 'A1:F40',folder= remote_folder)
api.search_broken_links_in_remote_range(request)
Perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lib 'lib';
use strict;
use warnings;
use File::Slurp;
use MIME::Base64;
use AsposeCellsCloud::CellsApi;
my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'CellsCloudClientId'}, client_secret => $ENV{'CellsCloudClientSecret'});
my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
my $remoteFolder = 'TestData/In';
my $bookFormulaXlsx = 'BookFormula.xlsx';
my $upload_file_request = AsposeCellsCloud::Request::UploadFileRequest->new( 'UploadFiles'=>{ $bookFormulaXlsx => $bookFormulaXlsx } ,'path'=>$remoteFolder . '/' . $bookFormulaXlsx );
my $request = AsposeCellsCloud::Request::SearchBrokenLinksInRemoteRangeRequest->new();
$request->{name} = $bookFormulaXlsx;
$request->{worksheet} = 'Sheet1';
$request->{cell_area} = 'A1:F40';
$request->{folder} = $remoteFolder;
$instance->search_broken_links_in_remote_range(request=> $request);
Go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main
import (
"os"
asposecellscloud "github.com/aspose-cells-cloud/aspose-cells-cloud-go"
)
func main() {
instance := asposecellscloud.NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"), "https://api.aspose.cloud", "v3.0")
remoteFolder := "TestData/In"
bookFormulaXlsx := "BookFormula.xlsx"
bookFormulaXlsxRequest := new(asposecellscloud.UploadFileRequest)
bookFormulaXlsxRequest.UploadFiles = make(map[string]string)
bookFormulaXlsxRequest.UploadFiles[bookFormulaXlsx] = bookFormulaXlsx
bookFormulaXlsxRequest.Path = remoteFolder + "/" + bookFormulaXlsx
bookFormulaXlsxRequest.StorageName =""
instance.UploadFile(bookFormulaXlsxRequest )
request := new (asposecellscloud.SearchBrokenLinksInRemoteRangeRequest)
request.Name = bookFormulaXlsx
request.Worksheet = "Sheet1"
request.CellArea = "A1:F40"
request.Folder = remoteFolder
_, httpResponse, err := instance.SearchBrokenLinksInRemoteRange(request)
if err != nil {
t.Error(err)
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
t.Fail()
}
}