The Integration tab for a deployment includes details about the API keys, as well as code formats to use to generate prediction and stability requests.

Create a new API key

Create an API key for access to the deployment. Access to the endpoint ceases when the API key expires or when an authorized user revokes the API key.
Note

You must have User permissions, not Viewer permissions to create new API keys.

  1. Open the Deployments page.
  2. Select a deployment name to open the deployment details area.
  3. Open the Integration tab.
  4. Under API Keys, select Create API Key.
  5. Enter the key name and an expiration date. The maximum expiration date is one year.
  6. Select Create.
Copy the API Key to the clipboard and save in a safe location. Minitab Model Ops does not save this key, and you will not be able to view or copy it later.
Note

Before you distribute this API key, make sure you are authorized by your organization to publicly share the model data. Anyone with this API key has access to send prediction and stability requests for a model without additional authentication. Minitab disclaims all liability for model data that are publicly shared in violation of your organization’s policies and procedures.

Generate code format for prediction requests

Generate the code required for prediction requests. You can generate the code format for a single row, multiple rows, or an entire file of data. Copy this code and use your API key and data to send to endpoints.
  1. Open the Deployments page.
  2. Select a deployment name to open the deployment details area.
  3. Open the Integration tab.
  4. Under Sample Code, select Prediction.
  5. In Data, select whether to create code for a single row, multiple rows, or a data file. In Method, the choice of cURL GET or cURL POST depends on whether you use a single row or more than a single row.
    • With Single row, choose cURL GET or cURL POST.
    • With Multiple rows or File, use cURL POST.
    You can change the values for the variables. Select Submit Request to verify the endpoint.
    Note

    Commas and semicolons are not permitted in file paths.

    For information on prediction data requirements, go to Requirements for production data.
  6. Select Copy. Add your API key and any data values you want to include, then submit to your terminal. Use a leading zero in decimal numbers less than 1. For instance, use 0.25, not .25.
    Note

    The sample code uses a period as the decimal separator for numeric values.

To see an example of a python request, go to Sample Python code for a prediction request.

Generate code format for stability requests

Generate the code required for stability requests. You can generate the code format for a single row, multiple rows, or an entire file of data. Copy this code and use your API key and data to send to endpoints.
  1. Open the Deployments page.
  2. Select a deployment name to open the deployment details area.
  3. Open the Integration tab.
  4. Under Sample Code, select Stability.
  5. In Data, select whether to create code for a single row, multiple rows, or a data file. The Method for all data arrangements is cURL POST. You can change the values for the variables. Select Submit Request to verify the endpoint.
    Note

    Commas and semicolons are not permitted in file paths.

    For information on stability data requirements, go to Requirements for stability data.
  6. Select Copy. Add your API key and any data values you want to include, then submit to your terminal. Use a leading zero in decimal numbers less than 1. For instance, use 0.25, not .25.
    Note

    The sample code uses a period as the decimal separator for numeric values.

To see an example of a python request, go to Sample Python code for a stability request.

Region headers with files

When you use a file to submit a request, you must also specify the region.
curl -X POST -F 'data=@<name_of_file>' -H 
"Accept-Language: en-US" -H "ApiKey: API_KEY" 
'https://modeler-test.minitab.com/api/score'

For more information on available regions, go to Language and regional settings.