Segmentation API v2

From Memsource
Jump to: navigation, search

Create New Segmentation Rule

action: api/v2/segRule/create
    token                       string
    name                        string
    locale                      locale
    primary                     boolean                        O(false)
    file                        exfile                         

response: JSON
    {
      "id": 39                 // id of the new segmentation rule
    }

Get Segmentation Rule

action: api/v2/segRule/get
    token                       string
    segmentationRule            domain(SegRule)
  
response: JSON
    {
       "id":1,
       "filename":"en.srx",
       "dateCreated":"2016-05-10T19:05:39+0000",
       "createdBy":
          {
             "id":1
          },
       "name":"Seg. Rule Test",
       "locale":"en",
       "primary":true
    }

List Segmentation Rules

action: api/v2/segRule/list
    token                       string
    page                        integer            O(0)
    name                        string             O

response: JSON
   [
      {
         "id":1,
         "filename":"en.srx",
         "dateCreated":"2016-05-10T19:40:04+0000",
         "createdBy":
            {
               "id":1
            },
         "name":"Seg. Rule Test",
         "locale":"en",
         "primary":true
      }
   ]

Edit Segmentation Rule

action: api/v2/segRule/edit
    token                       string
    segmentationRule            domain(SegRule)
    name                        string
    locale                      locale
    primary                     boolean                        O(false)

response: empty

Delete Segmentation Rule

action: api/v2/segRule/delete
    token                       string
    segmentationRule            domain(SegRule)

response: empty