Add role

<< Click to Display Table of Contents >>

Current:  System Integration > WebAPI 

Add role

Previous pageReturn to chapter overviewNext page

Request address

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

Request message

 

Request parameter

 

required parameter :xmlData(required)

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

<info>

  <role>

     <name>aaa</name>

  </role>

</info>

parametric description

 

Request parameters are role information :

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

Sample

 

function addRole() {

  var xml = getXml();

  $.post("http://" + ip + ":" + port + "/" + project + "/api?action=saveNode&type=role&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>Id already exists.</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.