Skip to main content

Retrieve Invocation Results

After creating an invocation, you can retrieve the status of the invocation by using the endpoint /api/invocation/{invocationId}.

curl --location 'https://nostradamus.u-hopper.com/api/invocation/{invocation-id}' \
--header 'Authorization: Token my-secret-token'

When the status of request changes to completed is possible to access the invocationResults key and see what results and in which formats these are available for download, including json, csv and xlsx. In fact, an invocation can produce multiple results, and each result can be available in different formats. The primary result is the one that is considered the main result of the invocation while the others are accessory results.

The value of the invocationResults key will be similar to the following example:

{
"resultId": {
"primaryResult": true,
"status": "completed",
"jsonAvailable": true,
"csvAvailable": true,
"xlsxAvailable": true
}
}

where:

  • resultId is the id of the result;
  • primaryResult is a boolean that indicates if the result is the primary result;
  • status is the status of the result (it can be completed, error);
  • jsonAvailable is a boolean that indicates if the result is available in json format;
  • csvAvailable is a boolean that indicates if the result is available in csv format;
  • xlsxAvailable is a boolean that indicates if the result is available in xlsx format.

The primary result can be downloaded in different formats, including json, csv and xlsx by using the following endpoints, respectively:

  • /api/invocation/{invocationId}/json to retrieve the results in JSON format;
  • /api/invocation/{invocationId}/csv to retrieve the results in CSV format;
  • /api/invocation/{invocationId}/xlsx to retrieve the results in XLSX format.

The following example shows how to retrieve the primary result of an invocation in JSON format:

curl --location 'https://nostradamus.u-hopper.com/api/invocation/my-invocation-request-id/json' \
--header 'Authorization: Token my-secret-token'

The response will contain the results of the invocation in JSON format. The structure of the response will depend on the type of invocation that was performed: find out more in the following sections.

All the results can be downloaded in different formats, including json, csv and *xlsx by using the following endpoints, respectively:

  • /api/invocation/{invocation-id}/result/{result-id}/json;
  • /api/invocation/{invocation-id}/result/{result-id}/csv;
  • /api/invocation/{invocation-id}/result/{result-id}/xlsx.

The following example shows how to retrieve the result of an invocation in JSON format:

curl --location 'https://nostradamus.u-hopper.com/api/invocation/{invocation-id}/result/{result-id}/json' \
--header 'Authorization: Token my-secret-token'