envelope

Wraps the data of a response in an envelope that carries additional information, such as the after value for the next page.

Applies to: latest, timeseries, batchrun

Value: true or false. In API version 1 the default is false. In API version 2 the default is true.

The stream and archive services always respond with an envelope and refuse the envelope parameter. The batchrun service always uses an envelope.

Note: Set envelope=true explicitly when you page through results. The envelope contains the correctly calculated after value, and a requestId that you should log to trace problems.

Contents

The envelope has a field named after the service (latest, timeseries or batchrun) that holds the data, and:

FieldDescription
requestIdThe identifier of the request.
afterThe value for the after parameter of the next request.
nextThe URL of the next page, with nextUrl=true.
cursorThe position in the stream that the data corresponds to, with showStreamCursor.
timeToFirstWriteThe time in milliseconds the server needed before it started to send the response.
warningWarnings, for example that a quota reaches its limit or that a deprecated feature was used.
{
  "latest": [...],
  "requestId": "A011.1598447117.14",
  "timeToFirstWrite": 2,
  "after": "19101427"
}

With format=CSV the CSV has an additional last column after. The value in the last cell of the last row is the after value for the next request. With nextUrl there is a column next as well.

Important: New fields can be added to the envelope at any time. Client applications must ignore fields they do not know.