GoPlant API: Test Get
  • Description / Endpoint Version: 1.0
    This endpoint is used to verify you are sending the correct 'Authorization' header to the GoPlant API. Please contact your GoPlant administrator for your API basic authorization credentials.
  • 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 - Tag Source
  • Accepts:
    URL: http://demo.goplant.mobi/api/svc/Historian/Test
    Method: GET
    Authorization: Basic
    • Username: [Contact The GoPlant Administrator]
    • Password: [Contact The GoPlant Administrator]
    Headers:
    • Content-Type: application/json
    Body:
    • [empty]
    • 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:
    
    
                    
  • 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.
    Response Example:
    {
        "status": {
            "HTTPStatusCode": 200,
            "HTTPStatus": "Welcome. You have successfully accessed the API.",
            "RowStart": 0,
            "RowsReturned": 0,
            "LastIdReturned": 0,
            "RequestBegin": "2019-03-27T20:17:19.2388704Z",
            "StopWatch": {
                "IsRunning": true,
                "Elapsed": "00:00:00.0442767",
                "ElapsedMilliseconds": 45,
                "ElapsedTicks": 458859
            },
            "APIversion": "5.7.4.0",
            "EndpointVersionReturned": 1,
            "ExternalRequest": null
        },
        "data": null
    }
    
  • 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 ...
  • curl Example:
                            
    curl -X GET \
      http://localhost:9080/api/svc/Historian/Test \
      -H 'Authorization: Basic R29QbGFudEV4dGVybmFsQWNjZXNzOjc3NjRFRDE3Q0QyODRGNzhBNDYy' \
      -H 'Cache-Control: no-cache' \
                        
  • C# Example:
                            
    var client = new RestClient("http://localhost:9080/api/svc/Historian/Test");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Cache-Control", "no-cache");
    request.AddHeader("Authorization", "Basic R29QbGFudEV4dGVybmFsQWNjZXNzOjc3NjRFRDE3Q0QyODRGNzhBNDYy");
    IRestResponse response = client.Execute(request);
                        
  • Jquery Example:
                            
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://localhost:9080/api/svc/Historian/Test",
      "method": "GET",
      "headers": {
        "Authorization": "Basic R29QbGFudEV4dGVybmFsQWNjZXNzOjc3NjRFRDE3Q0QyODRGNzhBNDYy",
        "Cache-Control": "no-cache",
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });