Asynchronous API v3

From Memsource
Jump to: navigation, search

Get Asynchronous Request

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

response: JSON
    {
      "id":1415,
      "createdBy":{
        "id":1
      },
      "asyncResponse":{
        "error":{
          "code":"foo",
          "description":"bar"
        },
        "dateCreated":"2014-11-03T16:12:13Z"
      },
      "action":"PRE_ANALYSE",
      "dateCreated":"2014-11-03T16:12:05Z",
      "project": { 
        "id": 2411 
      },
      "parent": { 
        "id": 278211 
      }
    }

List Pending Requests

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

response: JSON
    [
      {
        "id":1415,
        "createdBy":{
          "id":1
        },
        "asyncResponse":{
          "error":{
            "code":"foo",
            "description":"bar"
          },
          "dateCreated":"2014-11-03T16:12:13Z"
        },
        "action":"PRE_ANALYSE",
        "dateCreated":"2014-11-03T16:12:05Z",
        "project": { 
          "id": 2411 
        },
        "parent": { 
          "id": 278211 
        },
        "children": {
        "total": 100,
        "finished": 67
        }
      }
    ]

Note: Maximum of 1000 pending requests are returned.