Keystone Batch Control Quality Control Interface REST API

From KeystoneIntranet
Jump to navigation Jump to search

Overview

The Keystone Batch Control Quality Control Interface is based on specification produced by Stonemont: File:BCQCI V3.pdf

See: Keystone_REST_Server_(KServer) for more on KServer.

Configuration

While KServer comes preconfigured to support the Batch QC API for all companies an any active port, it is best to assign a specific port. This allows for tighter security configuration now and down the road.

Sample KSERVER.INI:

[config]
ports=8211,8212
[config_8212]
logevents=SERVER,ERROR,REQUEST,RESPONSE,QUERY
CoId=001

Base URI

   http://<Ip Address>:port/rest/kbcqciapi1/<Company ID>

Test Connection Company 002:

   http://127.0.0.1:8212/rest/kbcqciapi1/002/connection

Supported Calls

   BatchResults/{PlantNo}/{BeginDate}/{EndDate}
   BatchResults/{PlantNo}/{BeginDate}
   BatchResultsMix/{PlantNo}/{MixCode}/{BeginDate}/{EndDate}
   BatchResultsMix/{PlantNo}/{MixCode}/{BeginDate}
   BatchResultsTicket/{PlantNo}/{ticketnumber}
   BatchResultList/{PlantNo}/{BeginDate}/{MaxResults}
   BatchResultList/{PlantNo}/{BeginDate}/{EndDate}/{MaxResults}
   BatchResultMixList/{PlantNo}/{MixCode}/{BeginDate}/{MaxResults}
   BatchResultMixList/{PlantNo}/{MixCode}/{BeginDate}/{EndDate}/{MaxResults}
   BatchResultsCondensed/{PlantNo}/{BeginDate}/{EndDate}/{MinLoadSize}/{MaxResults}
   BatchResultsCondensed/{PlantNo}/{MixCode}/{BeginDate}/{EndDate}/{MinLoadSize}/{MaxResults}
   connection
   Customers
   Customers/{CustNo}
   CustomersSince/{SinceDate}
   Customerlist
   MaterialList
   MaterialList/{PlantNo}
   MaterialList/{PlantNo}/{MatCode}
   Materials
   Materials/{PlantNo}
   Materials/{PlantNo}/{MatCode}
   mixdesigns
   mixdesigns/{PlantNo}
   mixdesigns/{PlantNo}/{MatCode}
   mixdesignlist
   mixdesignlist/{PlantNo}
   mixdesignlist/{PlantNo}/{MatCode}
   plants
   plants/{PlantNo}
   Projects/{CustNo}
   Projects/{CustNo}/{ProjectID}
   ProjectsSince/{SinceDate}
   Projectlist/{CustNo}
   Projectlist

Test Calls

List of mixes, plant 01, company 001

http://127.0.0.1:8212/rest/kbcqciapi1/001/mixdesignlist/01

Batch Result List Co 001, Plant 01 from 05/01/19 to 05/02/19, 1000 max.

http://127.0.0.1:8212/rest/kbcqciapi1/001/BatchResultList/01/2019-05-01/2019-05-02/1000

Push mix design for Base Product 3010 Plant 06 to Keystone

[Put] http://127.0.0.1:8211/rest/kbcqciapi1/001/mixdesigns/06/3010
{"bcqci":
  {"mixdesigns":
    {"mixdesign":
      [{"mixinfo": 
         {"mix_plantcode":"06","mix_code":"3010","mix_name":"3000 PSI","mix_slump":4.0,"mix_air":1.5},
        "mixcomponents":
          {"mixcomponent":
            [{"mc_mixcode":"3010","mc_code":"78STONE","mc_unit":6,"mc_dosagetype":0,"mc_quantity":1675.0},
             {"mc_mixcode":"3010","mc_code":"SAND","mc_unit":6,"mc_dosagetype":0,"mc_quantity":1350.0},
             {"mc_mixcode":"3010","mc_code":"CEMENT1","mc_unit":6,"mc_dosagetype":0,"mc_quantity":550.0},
             {"mc_mixcode":"3010","mc_code":"WATER","mc_unit":11,"mc_dosagetype":0,"mc_quantity":31.0},
             {"mc_mixcode":"3010","mc_code":"AIR","mc_unit":10,"mc_dosagetype":0,"mc_quantity":3.0}
            ] 
          }
      }]
    }
  }
}

Specification

Enumerations

Units of Measure

Unit

0: None
1: inches
2: feet
5: ounces
6: pounds
7: short tons
10: fluid ounces
11: gallons
15: cubic feet
16: cubic yard
20: psi
25: minutes
26: hours
30: percent
101: millimeters
102: centimeters
103: meters
105: grams
106: kilograms
107: metric tons
110: milliliters
111: liters
115: cubic centimeters
116: cubic meters
120: MPa


Internet Status

200 OK
201 Created
204 No Content
400 Bad Request
401 Unauthorized
404 Not Found, 10 = unknown/unsupported resource specifier
405 Method Not Allowed
409 Conflict, database error (usually a unique constraint on add/update or foreign key constraint on a delete)
500 Internal Server Error, unknown error (catch all)
501 Not Implemented, 7 = unsupported or unknown http method (HEAD, TRACE, etc.)
503 Service Unavailable