Add group

<< Click to Display Table of Contents >>

Current:  System Integration > WebAPI 

Add group

Previous pageReturn to chapter overviewNext page

Request address

http://ip:port/bi/api?action=saveNode&type=group&token=xxxx

Request message

 

Request parameter

 

required parameter :xmlData(required)

<?xml version="1.0" encoding="UTF-8"?>

<info>

 <group>

         <name>testgroup</name>

         <parent>g1</parent>

         <roles>role1,role2</roles>

 </group>

</info>

parametric description

 

The request parameter is group information

1)name(required):Group name, group name cannot be special character“\ /:*?"<>|;,.”

2)parent(Do not fill in the group under the root, add the group under the group when required):The superior group in which the group is located,must be a group that exists in the system.

3)roles(optional):Contains a role that must be a role that exists in the ,more than one by comma,such as:role1,role2,role3。

Sample

 

function addGroup() {

  var xml = getXml();

  $.post("http://" + ip + ":" + port + "/" + project + "/api?action=saveNode&type=group&token=xxxx",

     {xmlData : xml},

     function(result) {

     writeXml(result);

  });

}

Response message

 

Response result

 

1) Successful operation

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

         <level>1</level>

         <message>Operates successfully.</message>

  </result>

</results>

2) Operation failure

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

         <level>6</level>

         <message>Group path already exists.</message>

  </result>

</results>

or

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

         <level>6</level>

         <message>Folder not found: g3.</message>

  </result>

</results>

Result description

 

The response result information is xml. direct parse.

1) Level return type, different values represent different return status, see appendix.

2) Message is the interface operation result information.