GoPlant API: Task / Round Status
  • Description / Endpoint Version: 1.0
    Endpoint returns statistics about rounds. Including the total number of round and the number of rounds that were completed. Also includes the total number of task rounds. Including the total number of task rounds that were completed.
  • Deprecated Endpoint:
    The V1 endpoint will continue to work and has the correct counts, it is best to use the new V2 API as it more correctly describes what each count is.
  • Change Log:
    • 1.0: Initial build.
    • API 2.0: For any of the endpoints that require a start and end date / time, you can now pass a storage group date / time with "StartDatetimeSG" and "EndDatetimeSG" instead of "StartDatetimeUTC" and "EndDatetimeUTC". Include "StorageGroupID" to tell the system which storage group date / time you are sending.

  • Authentication Type:
    GoPlant
  • Accepts:
    URL: http://demo.goplant.mobi/api/svc/Historian/RoundStatusBetweenDateTimes
    Method: Post
    Authorization: Basic
    • Username: [Contact The GoPlant Administrator]
    • Password: [Contact The GoPlant Administrator]
    Headers:
    • Content-Type: application/json
    Body:
    • Note: StartDatetime and EndDateTime are always UTC.
    • StartDatetimeUTC: Will return Task /Round Status information AFTER this UTC date / time.
    • EndDatetimeUTC: Will return Task /Round Status information BEFORE this UTC date / time.
    • Note: For endpoints that allow a date parameter, you can now use "StartDatetimeSG" or "EndDatetimeSG" to pass storage group timestamps. See the home page for more details.
    Accept Body Example:
    {
    	"ReturnType": "json",
    	"StartDatetimeUTC":"5/1/2018 15:00",
    	"EndDatetimeUTC": "6/1/2018 15:00",
    	"EndpointVersion": null (null = latest 1.x)
    }
    
  • Response:
    Status: 200
    Type: JSON
    Body:
    • Status Object: Holds status information about your request.
      • HTTPStatusCode: HTTP Status ID of the request.
      • HTTPStatus: HTTP Status string representation. EX. 'OK'
      • RowStart: The zero based first row that was returned.
      • RowsReturned: The actual number of rows returned in the Data object.
      • LastIdReturned: The Last Response ID Returned by this request. This is useful for the next call when you want new records.
      • RequestBegin: The UTC timestamp API received the request.
      • StopWatch: The elapsed time the API call.
      • APIversion: GoPlant internal API version.
      • EndpointVersionReturned: The endpoint version that was returned based on the request. ex. If no endpoint version was requested, this will show the latest 1.x version.
      • ExternalRequest: The request object that was passed. Includes the endpoint version that was requested and the actual endpoint version that was returned.
        • "EndpointVersion": null
        • "EndpointVersionReturned": 1.1
    • Data Object: Holds the actual data that you are requesting.
      • StorageGroupId: GoPlant internal ID.
      • StorageGroupPath: Storage Group path including any children.
      • TotalTaskRounds: Total available round / variants that are in a task.
      • CompletedTaskRounds: Total completed round / variants that are in a task.
      • TotalRounds: Total round variants that have been drafted, started or completed that are not in a task.
      • CompletedRounds: Total completed round variants that are not in a task.
    Response Example:
    {
        "status": {
            "HTTPStatusCode": 200,
            "HTTPStatus": "OK",
            "RowStart": 0,
            "RowsReturned": 200,
            "LastIdReturned": -1,
            "RequestBegin": "2018-06-13T14:29:53.240318Z",
            "StopWatch": {
                "IsRunning": true,
                "Elapsed": "00:00:00.0125560",
                "ElapsedMilliseconds": 13,
                "ElapsedTicks": 34970
            },
            "APIversion": "3.25.0.0",
            "EndpointVersionReturned": 1.0
            "ExternalRequest": {
                "RowStart": 0,
                "RowCount": 0,
                "StartDatetimeUTC": "2018-05-01T15:00:00",
                "EndDatetimeUTC": "2018-06-01T15:00:00",
                "ResponseID": null,
                "TagSourceCodeName": null,
                "ReturnType": 1,
                "EndpointVersion": null,
                "EndpointVersionReturned": 1.0
            }
        },
      "data": [
          {
              "StorageGroupId": 357,
              "StorageGroupPath": "FASQA / Company Name / Plant-1 / Unit1-1",
              "TotalTaskRounds": 8,
              "CompletedTaskRounds": 0,
              "TotalRounds": 3,
              "CompletedRounds": 3
          },
          {
            "StorageGroupId": 365,
            "StorageGroupPath": "FASQA / Company Name / Plant-4 / Unit4-1",
            "TotalTaskRounds": 634,
            "CompletedTaskRounds": 0,
            "TotalRounds": 0,
            "CompletedRounds": 0
          },
        
          {
            "StorageGroupId": 390,
            "StorageGroupPath": "FASQA / Bryans Testing / Group 1728",
            "TotalTaskRounds": 0,
            "CompletedTaskRounds": 0,
            "TotalRounds": 1,
            "CompletedRounds": 0
          }
      ]
    }
    
  • On Failure:
    • If you do not provide a basic authorization header you will get an empty body with a status of 401 Unauthorized.
    • If your basic authorization header Username or Password is incorrect, you will get this message with a status of 401 Unauthorized.
      {"message": "Unauthorized API access"}
    • If you do not supply a json object in your body, you will get this message with a status of 500 Internal Server Error.
      {"message": "Missing body in post."}
    • If you pass a RowStart less than zero, you will get this message with a status of 500 Internal Server Error.
      {"message": "RowStart cannot be less than 0."}
    • If you pass a RowCount less than zero, you will get this message with a status of 500 Internal Server Error.
      {"message": "RowCount cannot be less than 0."}
    • If TagSourceCodeName is required and you do not pass it, you will get this message with a status of 500 Internal Server Error.
      {"message": "You must pass a source code name."}
    • If a Start, End or last update date / time is required but not passed, you will get this message with a status of 500 Internal Server Error.
      {"message": "StartDatetimeUTC cannot be null"}
      OR
      {"message": "EndDatetimeUTC cannot be null"}
      OR
      {"message": "LastUpdateUTC cannot be null"}
    • If you pass an invalid version number, you will get this type of response.
      {"message": "ResponsesBetweenResponseDate Error: Invalid Version Requested [1.1].   at ...
    • If you pass a malformed StartDateTime or EndDatetime, you will get a 500 Internal Server Error:
       "message": "Could not convert string to DateTime: 5/25/20189 15:00. Path 'StartDatetime', line 2, position 36."
  • curl Example:
                            
    curl -X POST \
      http://localhost:9080/api/svc/TaskRoundStatus \
      -H 'Authorization: Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF' \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/json' \
      -d '{
    	"ReturnType": "json",
    	"StartDatetimeUTC":"5/1/2018 15:00",
    	"EndDatetimeUTC": "6/1/2018 15:00"
    }'
                        
  • C# Example:
                            
    var client = new RestClient("http://localhost:9080/api/svc/TaskRoundStatus");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Cache-Control", "no-cache");
    request.AddHeader("Authorization", "Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("undefined", "{\n\t\"ReturnType\": \"json\",\n\t\"StartDatetimeUTC\":\"5/1/2018 15:00\",\n\t\"EndDatetimeUTC\": \"6/1/2018 15:00\"\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
                        
  • Jquery Example:
                            
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://localhost:9080/api/svc/TaskRoundStatus",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "Authorization": "Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF",
        "Cache-Control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"ReturnType\": \"json\",\n\t\"StartDatetimeUTC\":\"5/1/2018 15:00\",\n\t\"EndDatetimeUTC\": \"6/1/2018 15:00\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });