I am trying to add a label to a term using the following code:
var taxonomyContext = SP.ClientContext.get_current();
var taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(taxonomyContext);
var termStores = taxonomySession.get_termStores();
var termStore = termStores.getByName("TaxonomyName");
var projectNumberTermSet = termStore.getTermSet("termsetid");
var term = projectNumberTermSet.getTerm("theguid");
taxonomyContext.load(term);
var newLabel = term.createLabel("new label name", 1033, false);
taxonomyContext.load(newLabel);
taxonomyContext.executeQueryAsync(successHandler, errorHandler);
The following error is returned:
Could not complete cross-domain call: Access denied. You do not have permission to perform this action or access this resource.
I am able to successfully add terms to the same termstore via javascript, so not sure how it can actually be a permissions problem.
The platform is Office 365.
The code is running in a sharepoint-hosted app.
Anyone come across this issue before?