How to create Microsoft Spreadsheet Excel workbook using SmartMarker with Aspose.Cells REST API

Hi,

we are in the process of evaluating the Cloud API to see if it fits our needs.

We are trying to use the smartmarker capability, but it is not clear as to how to use it:

We created an example that calls the https://api.aspose.com/v1.1/cells/genericTemplate.xlsx/smartmarker with the appSID and signature in POST where the body is an XML representing the information (see both attached).

In the response we get:

{“Version”:{“Major”:1,“Minor”:1,“Build”:-1,“Revision”:-1,“MajorRevision”:-1,“MinorRevision”:-1},“Content”:{“Headers”:[{“Key”:“Content-Type”,“Value”:[“application/vnd.ms-excel”]}]},“StatusCode”:200,“ReasonPhrase”:“OK”,“Headers”:[],“RequestMessage”:null,“IsSuccessStatusCode”:true}

and there is no file created.

How can we get the created excel file?

Thanks,

Yisha

Hi,

there differences in the documentation of this functionality.

In java /.net the documentation is to use something like:

http://api.saaspose.com/v1.0/cells/input.xls?templatefile=template.xls

In the cloud REST API the documentation is to use something like:

~/{file-name}/smartmarker?xmlFile={xml-file}

What’s the correct way?

Should we use the first URL with the XML as the body of the message?

Thanks,

Yishay

Hi Yishay,

Thanks for your posting and using Aspose.Cells for Cloud.

Please see the help relating to all REST URIs from the following link.

( Aspose.Cells Cloud - API References )

and this is the help of Smart Marker related URI

( Aspose.Cells Cloud - API References )

The smart marker URI is

POST
cells/{name}/smartmarker?appSid={appSid}&xmlFile={xmlFile}&storage={storage}&folder={folder}&outPath={outPath}
Smart marker processing result.

It expect xml file path in the URI itself and it means xml file itself be inside the storage space.

Hi Shakeel,

Thanks for the quick response.

Here the documentation specify that the XML can be included in the POST body.

Is that incorrect?

In the link you sent, “outPath” should be the full name including the target full path and target file name?

Thanks,

Yishay

Hi Yishay,

Both approaches are right, if you will not specify the xml file path, then you will have to specify it inside the body.

This documentation article shows it how to make use of this API. In this article, you will also be able to download the Designer Spreadsheet and see the XML used to specify data.

( https://docs.aspose.cloud/cells/tr/workbook/create/smartmarker/)