Search spreadsheet broken links Excel API : SearchSpreadsheetBrokenLinks
Search broken links in the local spreadsheet.
Interface Details
Endpoint
Copy PUT http://api.aspose.cloud/v4.0/cells/search/broken-links
Function Description
This method searches for broken links within a local spreadsheet file.It scans through all sheets and cells to identify any hyperlinks that no longer point to valid destinations, such as dead URLs or missing references.The operation is performed cloudly, requiring no cloud storage.Ensure you have the necessary permissions to read the source file.If the source file cannot be accessed, contains unsupported formats, or if an error occurs during the search 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 problematic URL.Users should review the results carefully to update or remove invalid links.
The request parameters of searchSpreadsheetBrokenLinks API are:
Parameter Name
Type
Path/Query String/HTTPBody
Description
Spreadsheet
File
FormData
Upload spreadsheet file.
worksheet
String
Query
Specify the worksheet for the replace.
cellArea
String
Query
Specify the cell area for the replace.
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_SearchSpreadsheetBrokenLinks
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string bookFormulaXlsx = "BookFormula.xlsx";
var request = new SearchSpreadsheetBrokenLinksRequest(
spreadsheet: "TestData/" + bookFormulaXlsx
);
cellsApi.SearchSpreadsheetBrokenLinks(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 ExampleSearchSpreadsheetBrokenLinks {
private CellsApi api;
public ExampleSearchSpreadsheetBrokenLinks(){
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 bookFormulaXlsx = "BookFormula.xlsx";
SearchSpreadsheetBrokenLinksRequest request = new SearchSpreadsheetBrokenLinksRequest();
request.setSpreadsheet("TestData/" + bookFormulaXlsx);
this.api.searchSpreadsheetBrokenLinks(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\SearchSpreadsheetBrokenLinksRequest;
$cellsApi = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl"));
$bookFormulaXlsx = "BookFormula.xlsx";
$request = new SearchSpreadsheetBrokenLinksRequest();
$request->setSpreadsheet( "TestData/" . $bookFormulaXlsx);
$$cellsApi->searchSpreadsheetBrokenLinks($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'])
book_formula_xlsx = 'BookFormula.xlsx'
request = AsposeCellsCloud::SearchSpreadsheetBrokenLinksRequest.new(:Spreadsheet=>'TestData/' + book_formula_xlsx);
@instance.search_spreadsheet_broken_links(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 bookFormulaXlsx = "BookFormula.xlsx"
var request = new model.SearchSpreadsheetBrokenLinksRequest();
request.spreadsheet = "TestData/" + bookFormulaXlsx;
return cellsApi.searchSpreadsheetBrokenLinks(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'))
book_formula_xlsx = 'BookFormula.xlsx'
request = SearchSpreadsheetBrokenLinksRequest( 'TestData/' + book_formula_xlsx)
api.search_spreadsheet_broken_links(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 $bookFormulaXlsx = 'BookFormula.xlsx';
my $request = AsposeCellsCloud::Request::SearchSpreadsheetBrokenLinksRequest->new();
$request->{spreadsheet} = 'TestData/' . $bookFormulaXlsx;
$instance->search_spreadsheet_broken_links(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")
bookFormulaXlsx := "BookFormula.xlsx"
request := new (asposecellscloud.SearchSpreadsheetBrokenLinksRequest)
request.Spreadsheet = "TestData/" + bookFormulaXlsx
_, httpResponse, err := instance.SearchSpreadsheetBrokenLinks(request)
if err != nil {
t.Error(err)
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
t.Fail()
}
}