Skip to main content
Version: 1.37

Integrate a Deployment

This article described how to seamlessly integrate your Deployment with other (business) applications. The integration process involves two steps:

  1. Generating a Deployment API Token
  2. Using the integration code and Deployment token to integrate the Deployment into your application.

Alternatively, you can interact with a Deployment using the Deeploy Python client.

To start, navigate to the deployment you want to integrate by selecting it from the Deployment overview.

Generating a Deployment API token

Next, navigate to the Integrate tab and scroll down to the Create token section.

The following elements can be configured for a token:

  • Token name: name of the token
  • Description (optional): description to clarify what the token is used for
  • Valid until (optional): token will be invalid after the supplied date

After creating a token, a pop-up appears with the Deployment API token. The Deployment API Token is a Bearer Token used in the Authorization Header of a HTTP request.

danger

Make sure to copy and store the token somewhere else immediately, as you cannot recover the token once you close the pop-up.

Using the integration code snippet

Next, scroll up and copy the snippet of choice to your clipboard. Deeploy provides code snippets for three different environments (see figure below):

  • Node.js
  • Python
  • Bash

The snippets require you to enter your token and your input tensor For your convenience, the code snippets for the three environments are included in this article as well.

var request = require('request');

// EXAMPLE: a batch prediction with two input tensors
const model_input = {
"instances": [
[0,1,0,1],
[1,0,1,0]
]
};

const options = {
method: 'POST',
url: '<DEPLOYMENT_API>/<METHOD>',
json: model_input,
auth: {
bearer: '<YOUR_TOKEN_HERE>',
},
};

request(options, function (error, response, body) {
if (error) throw new Error(error);

const model_output = body;
});