This section describes the three API JSON payload request and response formats for communication with either the GenRocket REST Engine or GenRocket Socket Engine. 


API Payload Formats

There are three payload formats:

  • The Request payload format
  • The OK response payload format
  • The FAILED response payload format


API Request Payload Format

A payload request requires two parameters and one subelement:

  • interfaceType - Must be set to 'Manual' and specifies that this is an API request format.
  • methodName - Defines the API method to call.
  • parameters - may contain zero or more parameters required by the method being called. 


{
  "interfaceType": "Manual",
  "methodName": "",
  "parameters": {
  }
}


API OK Response Payload Format

A successful payload response will contain one parameter and one subelement:

  • responseType: Set to 'OK'
  • data: may contain zero or more parameters required for the called method's response.


{
  "responseType": "OK",
  "data": {
    "someName1": "value",
    "someName2": "value",
    "someName3": "value"
  }
}


API FAILED Response Paylor Format

A failed payload response will contain one parameter and one subelement:

  • responseType: Set to 'FAILED'
  • messages: may contain an array of zero or more error messages.


{
  "responseType": "FAILED",
  "messages": [
    {
      "message": ""
    },
    {
      "message": ""
    },
    {
      "message": ""
    }
  ]
}