For everyone who wants to do the same. Here is the code:
var FolderID = scope.context.id;
var myFolderType;
var myFolderID;
scope.api.dms.getObject(FolderID).then(
function(result) {
if(result.data.folderid)
{
myFolderID=result.data.folderid;
}
else
{
scope.api.util.notifier.error('No Folder ID found');
}
if(result.data.FolderType)
{
myFolderType=result.data.FolderType;
}
else
{
scope.api.util.notifier.error('No Folder Type found');
}
},
function(error) {
scope.api.util.notifier.error(''+error, 'An error occured');
}
);`