Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ParameterTypeDescription
credentials (required)credentialsRead the description of the Credentials object
name (required)stringThe name of a new smart group. 
rules (required)array

The list of a smart group rules.

attributeType (required)int

Can have the following values:

  • 1— department

  • 2 — group

  • 3 — user profile field

attributeId (optional)stringThe user field ID. Should be filled out only if attributeType is 3.
operator (required)int

For departments:

  • 1 — a single department without any daughter departments 
  • 2 — a department and all its daughter departments 

For groups and user fields:

  • always 1
value (required)string

For departments:

  • the department ID

For groups:

  • the group ID

For user profile fields:

  • the user profile field value (for example, the value for the Last Name field is Smith)

Note: for the Country field, use the country ID, not its name. The country ID can be obtained with the Getting User Profile Fields method.

Return Value

After the request has been successfully processed, the system returns an object with the following properties:

Parameter

Type

Description

groupId

string

The ID of the added smart group.

Possible Errors

TypeError
Permission deniedThe user has no permissions to add smart groups.
Wrong parametersThe system failed to process the request because it did not contain all necessary parameters.

...

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="http://ispringlearn.com/go/services/api/soap">
  <SOAP-ENV:Body>
      <AddSmartGroupRequest>
       <credentials>
          <accountUrl>http://myaccount.ispringlearn.com</accountUrl>
          <email>email@email.com</email>
          <password>password</password>
         </credentials>
        <name> NEW GROUP</name>
        <rules>
            <and>
                <or>
                  <rule>
                    <attributeType>1<attributeType>
                    <attributeId> </attributeId>
                    <operator>2</operator>
                    <value>id_department</value>
                  </rule>
                </or>
                <or>
                  <rule>
                    <attributeType>2</attributeType>
                    <attributeId></attributeId>
                    <operator>1</operator>
                    <value>id_group</value>
                  </rule>
                </or>
                <or>
                  <rule>
                    <attributeType>3</attributeType>
                    <attributeId>JON_TITLE</attributeId>
                    <operator>1</operator>
                    <value>Sales Manager</value>
                  </rule>
                </or>
              </and>
            </rules>
      </AddSmartGroupRequest>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...

Sample Response

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns="http://ispringlearn.com/go/services/api/soap">
  <SOAP-ENV:Body>
    <AddSmartGroupResult>
      <groupId>string</groupId>
    </AddSmartGroupResult>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...