Status: Open
Status: Answered
Status: Closed
Status: Duplicate

REST API Create Virtual Folder

Posted Jun 16 by Mathijs Depuydt.


We're trying to create a Virtual Folder via the REST API. Currently we're having some issues with passing the correct "datatype" for the Selected Facets list.

We're getting the following error:
Error: Could not process object, invalid datatype for 'Selected Facets' .

The request we're sending to test is:

var xmlhttp = new XMLHttpRequest();
var strPath = '[LL_REPTAG_URLPREFIX /]/api/v2/nodes';'POST', strPath, true);
var myBody = 'type=' + encodeURIComponent(type) +
             '&name=' + encodeURIComponent(name) +
             '&parent_id=' + encodeURIComponent(parent_id) +
             '&location_id=' + encodeURIComponent(location_id) +
             '&selected_facets=' + selected_facets;

xmlhttp.onreadystatechange = function () {
   if (xmlhttp.readyState == 4) {
      if (xmlhttp.status == 200) {
         document.getElementById('#responseDiv').innerHTML = xmlhttp.responseText;

// Send the POST request
xmlhttp.setRequestHeader("OTCSTicket", token);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.setRequestHeader('Accept', 'application/json');

Which values should the selected_facets list contain? We've tried with ['2991',['0','144']] and {'2991',{'0','144'}} , but both requests provide the same "invalid datatype" error.

 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.


Related categories

Related tags

Your answer

To leave an answer, please sign in.