Get Outline Codes Information Introduction
This example allows you to retrieve Outline codes information, using Aspose.Tasks Cloud. Aspose.Tasks Cloud is a REST API which can be used with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more.
API
Type
Description
Resource Link
/tasks/{name}/outlineCodes
GET
Read TaskOutline Codes from a MS Project File
GetOutlineCodes
cURL Example
Request
Copy
curl - X GET "https://api.aspose.cloud/v3.0/tasks/Home%20move%20plan.mpp/outlineCodes" - H "accept: application/json"
Response
Copy {
"code" : 0 ,
"status" : "string" ,
"outlineCodes" : {
"link" : {
"href" : "string" ,
"rel" : "string" ,
"type" : "string" ,
"title" : "string"
},
"list" : [
{
"link" : {
"href" : "string" ,
"rel" : "string" ,
"type" : "string" ,
"title" : "string"
},
"index" : 0
}
]
}
}
SDKs
The Aspose.Tasks Cloud SDKs can be downloaded from the following page: Available SDKs
SDK Examples
C#
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-dotnet/
var remoteName = await UploadFileToStorageAsync("NewProductDev.mpp");
var response = await TasksApi.GetOutlineCodesAsync(new GetOutlineCodesRequest
{
Name = remoteName,
Folder = this.DataFolder
});
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.IsNotNull(response.OutlineCodes);
Assert.AreEqual(2, response.OutlineCodes.List.Count);
PHP
{
This file contains 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
<?
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-php/
$remoteName = "GetOutlineCodes.mpp";
$folder = $this->uploadFile("NewProductDev.mpp", $remoteName, '');
$response = $this->tasks->getOutlineCodes(new Requests\GetOutlineCodesRequest($remoteName, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
Assert::assertNotNull($response->getOutlineCodes());
Assert::assertEquals(2, count($response->getOutlineCodes()->getList()));
Python
This file contains 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
# For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-python
filename = 'NewProductDev.mpp'
self.upload_file(filename)
get_request = GetOutlineCodesRequest(filename)
get_result = self.tasks_api.get_outline_codes(get_request)
self.assertIsNotNone(get_result)
self.assertIsInstance(get_result, OutlineCodeItemsResponse)
self.assertEqual(2, len(get_result.outline_codes.list))
Node.js
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-node
const fileName = "NewProductDev.mpp";
const localPath = "./Data/" + fileName;
const remotePath = "Temp/Data";
const remoteFullPath = remotePath + "/" + fileName;
await tasksApi.uploadFileToStorage(remoteFullPath, localPath);
const request = new GetOutlineCodesRequest();
request.name = fileName;
request.folder = remotePath;
const result = await tasksApi.getOutlineCodes(request);
expect(result.response.statusCode).to.equal(200);
expect(result.body.outlineCodes).not.undefined.and.not.null;
expect(result.body.outlineCodes.list.length).to.equal(2);
Go
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-go/
client, ctx := UploadTestFileToStorage(t, localFileName, remoteBaseTestDataFolder+"/"+remoteFileName)
options := &requests.GetOutlineCodesOpts{
Name: remoteFileName,
Folder: optional.NewString(remoteBaseTestDataFolder),
}
result, _, err := client.TasksApi.GetOutlineCodes(ctx, options)
if err != nil {
t.Error(err)
}
assert.Equal(t, int32(200), result.Code)
assert.NotNil(t, result.OutlineCodes)
assert.Equal(t, 2, len(result.OutlineCodes.List))
Java
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-java/
String localFileName = "NewProductDev.mpp";
String remoteFileName = TestInitializer.UploadFile(localFileName);
GetOutlineCodesRequest request = new GetOutlineCodesRequest(remoteFileName, null, null);
OutlineCodeItemsResponse result = TestInitializer.tasksApi.getOutlineCodes(request);
assertNotNull(result);
assertEquals(200, (int) result.getCode());
assertNotNull(result.getOutlineCodes());
assertEquals(2, result.getOutlineCodes().getList().size());