Rules Resource

GET /rules

Returns the list of all the Rules created under the account of the currently connected user.

Response Body
media type data type description
application/json RulesResult (JSON) The list of requested Rule objects.
The flag rulesEmpty is set to true if no rules exist
application/xml rulesResult (XML)

Example

Request
GET /rules
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "rulesEmpty" : true,
  "rule" : [ {
    "id" : 12345,
    "accountId" : 12345,
    "name" : "...",
    "description" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "synchronizedOn" : 12345,
    "enabled" : true,
    "query" : "...",
    "ruleActionConfigurations" : [ {
      "name" : "...",
      "parameters" : { }
    }, {
      "name" : "...",
      "parameters" : { }
    } ],
    "optlock" : 12345
  }, {
    "id" : 12345,
    "accountId" : 12345,
    "name" : "...",
    "description" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "synchronizedOn" : 12345,
    "enabled" : true,
    "query" : "...",
    "ruleActionConfigurations" : [ {
      "name" : "...",
      "parameters" : { }
    }, {
      "name" : "...",
      "parameters" : { }
    } ],
    "optlock" : 12345
  } ]
}
                
              

POST /rules

Creates a new Rule based on the information provided in RuleCreator parameter.

Request Body
media type data type description
application/xml ruleCreator (XML) Provides the information for the new Rule to be created.
Response Body
media type data type description
application/xml rule (XML) The newly created Rule object.

Example

Request
POST /rules
Content-Type: application/xml
Accept: application/xml

                
<ruleCreator xmlns="http://eurotech.com/edc/2.0">
  <accountId>...</accountId>
  <name>...</name>
  <description>...</description>
  <enabled>...</enabled>
  <query>...</query>
  <ruleActionConfigurations>
    <ruleActionConfiguration>
      <name>...</name>
      <parameters>
        <parameter/>
      </parameters>
    </ruleActionConfiguration>
  </ruleActionConfigurations>
</ruleCreator>

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/xml

                
<rule xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <description>...</description>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <synchronizedOn>...</synchronizedOn>
  <enabled>...</enabled>
  <query>...</query>
  <ruleActionConfigurations>
    <ruleActionConfiguration>
      <name>...</name>
      <parameters>
        <parameter/>
      </parameters>
    </ruleActionConfiguration>
  </ruleActionConfigurations>
  <optlock>...</optlock>
</rule>

                
              

GET /rules/actions

Returns the list of all the Rule Actions available.

Response Body
media type data type description
application/json RuleActionInfosResult (JSON) The list of requested Rule Actions.
application/xml ruleActionInfosResult (XML)

Example

Request
GET /rules/actions
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "RuleActionInfo" : [ {
    "name" : "...",
    "parameterInfos" : [ {
      "name" : "...",
      "type" : "largeText",
      "regex" : "...",
      "mandatory" : true,
      "default" : "...",
      "choices" : [ "...", "..." ]
    }, {
      "name" : "...",
      "type" : "time",
      "regex" : "...",
      "mandatory" : true,
      "default" : "...",
      "choices" : [ "...", "..." ]
    } ]
  }, {
    "name" : "...",
    "parameterInfos" : [ {
      "name" : "...",
      "type" : "time",
      "regex" : "...",
      "mandatory" : true,
      "default" : "...",
      "choices" : [ "...", "..." ]
    }, {
      "name" : "...",
      "type" : "date",
      "regex" : "...",
      "mandatory" : true,
      "default" : "...",
      "choices" : [ "...", "..." ]
    } ]
  } ]
}
                
              

DELETE /rules/{ruleId}

Deletes the Rule specified by the "id" path parameter.

Request Parameters
name type description constraints
ruleId path The id of the Rule to be deleted. required

Example

Request
DELETE /rules/{ruleId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /rules/{ruleId}

Returns the Rule specified by the "id" path parameter.

Request Parameters
name type description constraints
ruleId path The id of the Rule requested. required
Response Body
media type data type description
application/json Rule (JSON) The requested Rule object.
application/xml rule (XML)

Example

Request
GET /rules/{ruleId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "accountId" : 12345,
  "name" : "...",
  "description" : "...",
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "synchronizedOn" : 12345,
  "enabled" : true,
  "query" : "...",
  "ruleActionConfigurations" : [ {
    "name" : "...",
    "parameters" : {
      "parameter" : [ { }, { } ]
    }
  }, {
    "name" : "...",
    "parameters" : {
      "parameter" : [ { }, { } ]
    }
  } ],
  "optlock" : 12345
}
                
              

PUT /rules/{ruleId}

Updates the Rule specified by the "id" path parameter based on the information provided in the Rule parameter.

Request Parameters
name type description
ruleId path The id of the Rule to be updated.
Request Body
media type data type description
application/xml rule (XML) The modified Rule whose attributed need to be updated.
Response Body
media type data type description
application/xml rule (XML) The updated rule.

Example

Request
PUT /rules/{ruleId}
Content-Type: application/xml
Accept: application/xml

                
<rule xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <description>...</description>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <synchronizedOn>...</synchronizedOn>
  <enabled>...</enabled>
  <query>...</query>
  <ruleActionConfigurations>
    <ruleActionConfiguration>
      <name>...</name>
      <parameters>
        <parameter/>
      </parameters>
    </ruleActionConfiguration>
  </ruleActionConfigurations>
  <optlock>...</optlock>
</rule>

                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/xml

                
<rule xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <description>...</description>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <synchronizedOn>...</synchronizedOn>
  <enabled>...</enabled>
  <query>...</query>
  <ruleActionConfigurations>
    <ruleActionConfiguration>
      <name>...</name>
      <parameters>
        <parameter/>
      </parameters>
    </ruleActionConfiguration>
  </ruleActionConfigurations>
  <optlock>...</optlock>
</rule>