Specific method responses for IMS

A successful response generates an HTTP status code of 200. Failures produce an appropriate status code and an error message describing the cause of the failure.

Z Data Tools Service Provider generates the following JSON format in response to a successful specific method request for IMS™ data:
{
    "segments" :
    [
        {
            "last" : boolean,
            "segment-name" :
            {
                "layout-name" :
                {
                    "field1-name" : "value",
                    "field2-name" : "value",
                    "field3-name" : "value",
                    "fieldn-name" : "value"
                }
            }
        }
    ],
    "token" : "string"
}

Key fields for a specific method response are explained in the following table:

Key Description
segments An array of 0 or more segments from the IMS data resource.
last If present, indicates whether the segment is the last in the IMS resource.
segment-name The key is the name of the IMS database segment.
layout-name The key is the name of the record layout as in the Z Data Tools view. The value is an object containing one or more fields related to the layout.
field1-name
fieldn-name
The key is the name of the data field. The value is the value of the data field.
token A Z Data Tools session token. A token is returned when a request sets "session" : true and does not also pass a token value. The token represents a ZDT/IMS session running in the z/OS® environment and can be used by subsequent requests when multiple reads by a client are required.

To end the ZDT/IMS session, the client must send a request with the token and "session" : false, otherwise the session will eventually time out if inactive.