User API v3

From Memsource
Jump to: navigation, search

Create New User

action: api/v3/user/create
    token                       string
    userName                    string                             
    email                       string
    firstName                   string
    lastName                    string
    password                    string
    role                        enum(UserRole)
    timezone                    string                             O
    note                        string                             O
    terminologist               boolean                            O
    sourceLang                  list(locale)                       O
    targetLang                  list(locale)                       O
    workflowStep                list(domain(WorkflowStep))         O
    client                      list(domain(Client))               O
    projectBusinessUnits        list(domain(BusinessUnit))         O
    domain                      list(domain(Domain))               O
    subDomain                   list(domain(SubDomain))            O

response: JSON
    {
      "id": 238                 // id of the new user
    }

Edit User

action: api/v3/user/edit
    token                       string
    user                        domain(User)
    userName                    string                             O 
    email                       string                             O
    firstName                   string                             O
    lastName                    string                             O
    password                    string                             O
    role                        enum(UserRole)                     O
    timezone                    string                             O
    note                        string                             O
    active                      boolean                            O
    terminologist               boolean                            O
    sourceLang                  list(locale)                       O
    targetLang                  list(locale)                       O
    workflowStep                list(domain(WorkflowStep))         O
    client                      list(domain(Client))               O
    projectBusinessUnits        list(domain(BusinessUnit))         O
    domain                      list(domain(Domain))               O
    subDomain                   list(domain(SubDomain))            O

response: empty

Delete User

action: api/v3/user/delete
    token                       string
    user                        domain(User)

response: empty

Undelete User

action: api/v3/user/undelete
    token                       string
    user                        domain(User)

response: empty

Get Limits

action: api/v3/user/getLimits
    token                       string

response: JSON
   {
     "userCounts":{
       "PROJECT_MANAGER":{
           "max":10,
           "used":7
       },
       "LINGUIST":{
           "max":100,
           "used":91
       },
       "GUEST":{
           "max":0,
           "used":0
       }
     }
   }

Get User

action: api/v3/user/get
    token                       string
    user                        domain(User)

response: JSON
   {
     "id":3,
     "lastName":"bar",
     "email": "foo@bar.com",
     "targetLangs":[
       "en",
       "de",
       "cs"
     ],
     "userName":"foobar_1363963932291",
     "role":"LINGUIST",
     "timezone":"Europe/Prague",
     "active":true,
     "activeJobsCount": 0,
     "sourceLangs":[
       "en",
       "de"
     ],
     "firstName":"foo",
     "dateCreated":"2015-08-25T15:44:36Z",
     "login": {
       "lastLoginDate":"2015-12-25T15:44:36Z"
     },
     "workflowSteps":[
       {
         "id":1,
         "name":"Translation",
         "abbr":"T"
       }
     ],
     "accessSettings": {
        "editorMachineTranslateEnabled": true,
        "project": {
           "businessUnits": [
              {
                 "id":5,
                 "name":"BU Name"
              }
           ]
        }
     }
     "clients": [],
     "domains": [],
     "subDomains": []
   }

Get By User Name

action: api/v3/user/getByUserName
    token                       string
    userName                    string

response: JSON
 see user/get above

List Users

action: api/v3/user/list
    token                       string
    page                        integer                              O(0)
    user                        list(domain(User))                   O
    includeDeleted              boolean                              O(false)
    userName                    string                               O
    email                       string                               O

response: JSON
   [
     {
        ...       // see user/get API
     }
   ]

Send Login Info

action: api/v3/user/sendLoginInfo
    token                       string
    user                        domain(User)

response: empty