Get Labels

Get the list of all configured Labels.

URL: /rest-api/labels.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.

Response sample:

200 OK
[{"id":1,"value":"label1"},{"id":2,"value":"valelN"}, ... ]

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Get Rules

Get the list of all configured Rules.

URL: /rest-api/rules.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

Response sample:

200 OK
[{"id":1,"name":"name1","active":false,"defaultRule":false,"type":"CAMPAIGN","ruleMatches":[]}......]

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Get Rule

Get the Rule by its identifier.

URL: /rest-api/rule/{ruleId}.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Rule with such ID doesn't exist.

Response sample:

200 OK
{"id":{ruleId},"name":"name","active":false,"defaultRule":false,"type":"CAMPAIGN","ruleMatches":[]}

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Create Rule

Creates new Rule.

URL: /rest-api/rule/create.do
Method: POST
Request format: Method requires request body in JSON format. Rule will be created based on the inner-object properties. 
'JSON object': {"name":"name","active":false,"defaultRule":false,"type":"CAMPAIGN","ruleMatches":
[{"include":true,"categories":[1,2,3],"labels":[2,3,4],"operator":"OR"},...]}

Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Label(s) or Category(-ies) with such ID does not exist.

Required Headers:
Content-Type - application/json
Accept - application/json

Response sample:

200 OK
{"name":"name","active":false,"defaultRule":false,"type":"CAMPAIGN","ruleMatches":
[{"include":true,"categories":[1,2,3],"labels":[2,3,4],"operator":"OR"},...]}
Validation error messages can be returned in scope of response.

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Update Rule

Updates an existing Rule.

URL: /rest-api/rule/{ruleId}/update.do
Method: POST
Request format: Method requires request body in JSON format. Rule will be updated based on the inner-object properties.
'JSON object': {"name":"name","active":false,"defaultRule":false,"type":"CAMPAIGN","ruleMatches":
[{"include":true,"categories":[1,2,3],"labels":[2,3,4],"operator":"OR"},...]}

Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Label(s) or Category(-ies) with such ID does not exist.

Required Headers:
Content-Type - application/json
Accept - application/json

Response sample:

200 OK
Validation error messages can be returned in scope of response.

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Remove Rule

Removes the Rule by its identifier.

URL: /rest-api/rule/{ruleId}/delete.do
Method: POST
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Rule with given ID does not exist.

Response sample:

200 OK

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Add condition(s) to Rule

Adds new condition(s) to an existing Rule.

URL: /rest-api/rule/{ruleId}/matches/add.do
Method: POST
Request format: Method required request body in JSON format. Rule will be updated based on the inner-object properties.
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Rule with given ID does not exist.

Required Headers : 
Content-Type - application/json
Accept - application/json

Response sample:

200 OK
[{"include":true,"categories":[1,2,3],"labels":[2,3,4],"operator":"OR"},...]}
Validation error messages can be returned in scope of response.

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.
  • matches - represents request body in 'JSON' format. Depending on the object properties, Rule matches will be updated. Format : [{"include":true,"categories":[1,2,3],"labels":[2,3,4],"operator":"OR"},...].

Remove all conditions from the Rule

Removes all conditions from the Rule by its ID.

URL: /rest-api/rule/{ruleId}/matches/remove.do
Method: POST
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not found – Rule with given ID does not exist.

Response sample:

200 OK

Parameters:

  • hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
  • timestamp – UNIX timestamp in milliseconds used in hash generation.
  • username – the given username.

Need more help?

Should you require any additional help with our solutions, do not hesitate to contact Epom technical support at support@epom.com. Our support managers are dedicated to resolving any issues and providing you with solutions and support if you face difficulties or have questions.