Project API v3

From Memsource
Jump to: navigation, search

Assign Vendor

action: api/v3/project/assignVendor
    token                       string
    project                     domain(Project)
    vendor                      domain(Vendor)
    dateDue                     datetime                           O

response: empty

Create New Project

action: api/v3/project/create
    token                       string
    name                        string                             
    sourceLang                  locale
    targetLang                  list(locale)
    client                      domain(Client)                     O
    businessUnit                domain(BusinessUnit)               O
    domain                      domain(Domain)                     O
    subDomain                   domain(SubDomain)                  O
    dateDue                     datetime                           O
    note                        string                             O
    machineTranslateSettings    domain(MachineTranslateSettings)   O
    workflowStep                list(domain(WorkflowStep))         O
    useDefaultProjectSettings   boolean                            O(false)

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

Create New Project From Template

action: api/v3/project/createFromTemplate
    token                       string
    template                    domain(ProjectTemplate)
    name                        string                             
    dateDue                     datetime                           O
    note                        string                             O
    sourceLang                  string                             O   // overrides template data
    targetLang                  list(string)                       O   // overrides template data
    workflowStep                list(domain(WorkflowStep))         O   // overrides template data

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

Clone Project

action: api/v3/project/clone
    token                       string
    project                     domain(Project)
    name                        string                             

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

Edit Project

action: api/v3/project/edit
    token                       string
    project                     domain(Project)
    name                        string                             O
    status                      enum(ProjectStatus)                O
    targetLang                  list(locale)                       O    // adds target languages (existing cannot be removed)
    client                      domain(Client)                     O N
    businessUnit                domain(BusinessUnit)               O N
    domain                      domain(Domain)                     O N
    subDomain                   domain(SubDomain)                  O N
    dateDue                     datetime                           O N
    note                        string                             O N
    machineTranslateSettings    domain(MachineTranslateSettings)   O N
    workflowStep                list(domain(WorkflowStep))         O   // adds workflow steps (existing cannot be removed)
    owner                       domain(User)                       O

response: empty

Delete Project

action: api/v3/project/delete
    token                       string
    project                     domain(Project)
    purge                       boolean             O(false)

response: empty

Get Project Info

action: api/v3/project/get
    token                       string
    project                     domain(Project)

response: JSON
    {
      "id":129,
      "internalId":5,
      "name":"set completed (1)",
      "status":"NEW",
      "sourceLang":"en",
      "targetLangs":[
        "cs",
        "de"
      ],
      "dateDue":null,
      "dateCreated":"2016-03-10T14:22:10+0000",
      "createdBy": {
         "id": 501,
         "userName": "admin",
         "email": "support@memsource.com"
      }
      "note":null,
      "machineTranslateSettings":null,
      "workflowSteps":[
        {
          "abbr":"T",
          "id":1,
          "level":1,
          "name":"Translation"
        },
        {
          "abbr":"R",
          "id":2,
          "level":2,
          "name":"Revision"
        }
      ],
      "client":null,
      "businessUnit": {
         "id":5,
         "name":"BU Name"
      }
      "domain":null,
      "subDomain":null,
      "langSettings":[
        {
          "targetLang":"cs",
          "machineTranslateSettings":{
            "id":2,
            "name":"Microsoft with Feedback",
            "type":"MicrosoftTranslatorWithFeedback",
            "default":false
          }
        },
        {
          "targetLang":"de",
          "machineTranslateSettings":{
            "id":8,
            "name":"apert",
            "type":"Apertium",
            "default":true
          }
        }
      ],
      "qualityAssuranceSettings": {
        "emptyTranslation":true,
        "inconsistentTranslation":true,
        "joinTags":true,
        "missingNumbers":true,
        "segmentNotConfirmed":true,
        "terminology":true,
        "multipleSpaces":true,
        "trailingSpace":true,
        "trailingPunctuation":false,
        "targetLength": {
          "enabled": true,
          "max": 1000
        },
        "formatting":true,
        "unresolvedComment":true,
        "emptyPairTags":true,
        "strictJobStatus":false,
        "forbiddenStrings": {
          "enabled": false,
          "list": []
        },
        "excludeLockedSegments":false,
        "ignoreNotApprovedTerms":false,
        "spellCheck":true,
        "repeatedWords":true,
        "inconsistentTagContent":true,
        "emptyTagContent":true,
        "xliffTags":true,
        "forbiddenTerms":false,
        "targetLengthPercent" {
          "enabled": false,
          "max": 120.0
        },
        "targetLengthPerSegment":true,
        "newerAtPrecedingWorkflowStep":true,
        "leadingAndTrailingSpaces":true
      },
      "accessSettings: {
        "downloadEnabled":true,
        "webEditorEnabledForLinguists":true,
        "showUserDataToLinguists":true,
        "emailNotifications":true,
        "strictWorkflowFinish":false,
        "useVendors":false
      }      
    }

Set Status

action: api/v3/project/setStatus
    token                       string
    project                     domain(Project)
    status                      enum(ProjectStatus)

response: empty

Set Translation Memories

action: api/v3/project/setTransMemories
    token                       string
    project                     domain(Project)
    readTransMemory             list(domain(TransMemory))  O
    writeTransMemory            list(domain(TransMemory))  O    // write translation memory must be included in the read translation memories, too; max 2 write TMs allowed
    penalty                     list(double)               O    // a list of penalties for each read translation memory
    targetLang                  locale                     O    // set translation memories only for the specific project target language
    workflowStep                domain(WorkflowStep)       O    // set translation memories only for the specific workflow step

response: empty

Get Translation Memories

action: api/v3/project/getTransMemories
    token                       string
    project                     domain(Project)

response: JSON
   [
     {
       "writeMode":true,
       "transMemory":{
         "id":1,
         "targetLangs":[
           "de"
         ],
         "sourceLang":"en",
         "name":"transMem"
       },
       "targetLang":"de",
       "penalty":0,
       "readMode":true,
       "workflowStep":null
     }
   ]

Set Term Bases

action: api/v3/project/setTermBases
    token                       string
    project                     domain(Project)
    readTermBase                list(domain(TermBase))     O
    writeTermBase               domain(TermBase)           O    // write term base must be included in the read term bases
    qualityAssuranceTermBase    list(domain(TermBase))     O    // QA term bases must be included in the read term bases
    targetLang                  locale                     O    // set term bases only for the specific project target language

response: empty

Get Term Bases

action: api/v3/project/getTermBases
    token                       string
    project                     domain(Project)

response: JSON
   [
     {
       "writeMode":true,
       "termBase":{
         "id":1,
         "langs":[
           "de", "en"
         ],
         "name":"termBase"
       },
       "targetLang":"de",
       "readMode":true,
       "workflowStep":null
     }
   ]

List Projects

action: api/v3/project/list
    token                       string
    page                        integer                    O(0)
    name                        string                     O
    client                      string                     O
    businessUnit                string                     O
    status                      list(enum(ProjectStatus))  O
    targetLang                  list(locale)               O
    domain                      string                     O
    subDomain                   string                     O
    costCenter                  string                     O
    dueInHours                  integer                    O
    createdInLastHours          integer                    O
    sourceLang                  list(locale)               O
    owner                       domain(User)               O

response: JSON
   [
     {
       "id":1,
       "uid":"cU19tI7NPTOI8y3Ot4VbE7",
       "internalId":1,
       "name":"project",
       "status":"NEW",
       "sourceLang":"en",
       "targetLangs":[
         "cs",
         "de"
       ],
       "dateDue":null,
       "dateCreated":"2016-09-02T08:40:00+0000",
       "note":null,
       "machineTranslateSettings":null,
       "workflowSteps":[
   
       ],
       "client":null,
       "businessUnit":{
         "id":1,
         "name":"businessUnit"
       },
       "domain":null,
       "subDomain":null,
       "langSettings":[
   
       ],
       "createdBy":{
         "deleted":false,
         "active":true,
         "userName":"admin",
         "firstName":"admin",
         "id":1,
         "lastName":"test",
         "role":"ADMIN",
         "email":"test@test.com"
       },
       "qualityAssuranceSettings":{
         "emptyTranslation":true,
         "inconsistentTranslation":true,
         "joinTags":true,
         "missingNumbers":true,
         "segmentNotConfirmed":true,
         "terminology":true,
         "multipleSpaces":true,
         "trailingSpace":true,
         "trailingPunctuation":false,
         "targetLength":{
           "enabled":false,
           "max":1000
         },
         "formatting":true,
         "unresolvedComment":true,
         "emptyPairTags":true,
         "strictJobStatus":false,
         "forbiddenStrings":{
           "enabled":false,
           "list":[
   
           ]
         },
         "excludeLockedSegments":false,
         "ignoreNotApprovedTerms":false,
         "spellCheck":true,
         "repeatedWords":true,
         "inconsistentTagContent":true,
         "emptyTagContent":true,
         "xliffTags":true,
         "forbiddenTerms":false,
         "targetLengthPercent":{
           "enabled":false,
           "max":130.0
         },
         "targetLengthPerSegment":true,
         "newerAtPrecedingWorkflowStep":true,
         "leadingAndTrailingSpaces":true,
         "ignoreInAllWorkflowSteps":false,
         "regexp":{
           "source":null,
           "target":null
         }
       },
       "analyseSettings":{
         "type":"PreAnalyse",
         "includeFuzzyRepetitions":true,
         "includeConfirmedSegments":true,
         "includeNumbers":true,
         "includeLockedSegments":true,
         "countSourceUnits":true,
         "includeTransMemory":true,
         "compareWorkflowLevel":null
       }
     }
   ]

Edit Access & Security Settings

action: api/v3/project/editAccessSettings
    token                                 string
    project                               domain(Project)
    translationMemoryDownloadEnabled      boolean          O
    webEditorEnabledForLinguists          boolean          O
    showUserDataToLinguists               boolean          O
    emailNotifications                    boolean          O

response: empty

Edit Quality Assurance Settings

action: api/v3/project/editQualityAssuranceSettings
    token                                 string
    project                               domain(Project)
    emptyTranslation                      boolean          O
    inconsistentTranslation               boolean          O
    joinTags                              boolean          O
    missingNumbers                        boolean          O
    segmentNotConfirmed                   boolean          O
    terminology                           boolean          O
    multipleSpaces                        boolean          O
    trailingSpace                         boolean          O
    trailingPunctuation                   boolean          O
    targetLengthMax                       integer          O
    formatting                            boolean          O
    unresolvedComment                     boolean          O
    emptyPairTags                         boolean          O
    strictJobStatus                       boolean          O    // linguists may not set jobs with unresolved QA warnings to Completed
    forbiddenString                       list(string)     O
    excludeLockedSegments                 boolean          O
    ignoreNotApprovedTerms                boolean          O
    spellCheck                            boolean          O
    repeatedWords                         boolean          O
    inconsistentTagContent                boolean          O
    emptyTagContent                       boolean          O
    xliffTags                             boolean          O
    forbiddenTerms                        boolean          O
    targetLengthPercent                   double           O
    targetLengthPerSegment                boolean          O
    newerAtPrecedingWorkflowStep          boolean          O
    leadingAndTrailingSpaces              boolean          O
    moravia.enabled                       boolean          O
    moravia.profile                       string           O

response: empty