Skip to content

Commit f57cfca

Browse files
[N/A] - Added sample usage to readme file.
1 parent 036a6bc commit f57cfca

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ This repository contains Aspose.Tasks Cloud SDK for Node.js source code. This SD
77

88
To use these SDK, you will need App SID and App Key which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (free registration in Aspose Cloud is required for this).
99

10+
### Sample usage
11+
The examples below show how your application have to initiate and get a project's tasks using aspose-tasks-cloud library:
12+
``` js
13+
14+
const tasksApi = new TasksApi("Youre AppSid here", "Youre AppKey here");
15+
16+
const request: GetTasksRequest = { name: "ProjectFile.mpp", folder: "documents", storage: ""}
17+
18+
tasksApi.getTasks(request)
19+
.then((result) => {
20+
// Deal with a result
21+
console.log(result.response.statusCode);
22+
console.log(result.body);
23+
})
24+
.catch(function(err) {
25+
// Deal with an error
26+
console.log(err.reponse.statusCode);
27+
console.log(err.body);
28+
});
29+
30+
```
31+
32+
Every method returns a chainable promise.
33+
34+
[Tests](test) contain various examples of using the SDK. You have to create "testConfig.json" file in project root to run them.
35+
"testConfig.json" has the following structure
36+
``` json
37+
{
38+
"AppSid": "Youre AppSid here",
39+
"AppKey": "Youre AppKey here",
40+
"BaseUrl": "http://api.aspose.cloud"
41+
}
42+
```
43+
44+
For other examples, check the product [Developer Guide](https://docs.aspose.cloud/display/taskscloud/Developer+Guide).
45+
1046
# Licensing
1147
All Aspose.Tasks Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).
1248

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@asposecloud/aspose-tasks-cloud",
3-
"version": "19.10.0",
3+
"version": "19.10.1",
44
"description": "Aspose.Tasks Cloud SDK for Node.js",
55
"homepage": "https://products.aspose.cloud/tasks",
66
"readmeFilename": "README.md",

0 commit comments

Comments
 (0)