Asynchronous API v2

From Memsource
Jump to: navigation, search

Get Asynchronous Request

action: api/v2/async/getAsyncRequest
    token                       string
    asyncRequest                domain(AsyncRequest)

response: JSON
    {
      "id":1415,
      "createdBy":{
        "id":1,
        "lastName":"test",
        "email":"test@test.com",
        "userName":"admin",
        "role":"ADMIN",
        "active":true,
        "firstName":"admin"
      },
      "asyncResponse":{
        "error":{
          "code":"foo",
          "description":"bar"
        },
        "dateCreated":"2014-11-03T16:12:13Z"
      },
      "action":"PRE_ANALYSE",
      "dateCreated":"2014-11-03T16:12:05Z"
      "children": [
        {
          "id":1416,
          "createdBy":{
            "id":1,
            "lastName":"test",
            "email":"test@test.com",
            "userName":"admin",
            "role":"ADMIN",
            "active":true,
            "firstName":"admin"
          },
          "asyncResponse":{
            "error":{
              "code":"foo",
              "description":"bar"
            },
            "dateCreated":"2014-11-03T16:12:13Z"
          },
          "action":"PRE_ANALYSE",
          "dateCreated":"2014-11-03T16:12:05Z"           
          "children": [], // always empty list
          "project": { ... },
          "jobParts": [ { ... } ]
        }
      ]
      "project": { ... },
      "jobParts": // always empty list
    }

List Pending Requests

action: api/v2/async/listPendingRequests
    token                       string
    all                         boolean           O(false)   // can only be set by ADMINs

response: JSON
    [
      {
        "id":1,
        "createdBy":{
          "id":1,
          "lastName":"test",
          "email":"test@test.com",
          "userName":"admin",
          "role":"ADMIN",
          "active":true,
          "firstName":"admin"
        },
        "asyncResponse":null,
        "action":"PRE_ANALYSE",
        "dateCreated":"2015-01-06T16:07:56Z"
        "children": [
          {
            "id":1416,
            "createdBy":{
              "id":1,
              "lastName":"test",
              "email":"test@test.com",
              "userName":"admin",
              "role":"ADMIN",
              "active":true,
              "firstName":"admin"
            },
            "asyncResponse": null,
            "action":"PRE_ANALYSE",
            "dateCreated":"2014-11-03T16:12:05Z"           
            "children": [], // always empty list
            "project": { ... },
            "jobParts": [] // always empty list
          }
        ],
        "project": { ... },
        "jobParts": [ { ... } ]
      }
    ]