# Using the API Client
source: https://developer.mastercard.com/riskrecon-api/documentation/tutorials-and-guides/use-client-tutorial/index.md

This step-by-step tutorial guides you through the process of using the RiskRecon Open API Client.

## What you learn {#what-you-learn}

You can use the RiskRecon Open API Client for both the sandbox and production environment. In this tutorial, you learn how to:

* Configure and use the RiskRecon Open API Client in the sandbox environment
* Configure and use the RiskRecon Open API Client in the production environment

<br />

<br />

To move to the next step in the tutorial, click the subsequent step in the left navigation pane or click the **Next** button.

## Use the API Client in Production {#use-the-api-client-in-production}

Follow the instructions in the README.md file of the generated client to call APIs from it.

You should find the README.md file in the root directory of the generated client.

Here are some examples of calling APIs in the production environment from a Python, Elixir, Java, and Ruby client:
* Python
* Ruby
* Java
* Javascript

```python
import os
import openapi_client

configuration = openapi_client.Configuration(

        host = "https://api.riskrecon.com",

    # It is assumed here that the BEARER_TOKEN is set as an environment variable but you can retrieve it any way you like.
    access_token = os.environ["BEARER_TOKEN"]
)

# Call the `GET_TOES` API.

api_client = openapi_client.ApiClient(configuration)
toes_api_instance = openapi_client.TargetOfEvaluationTOEApi(api_client)
api_response = toes_api_instance.get_toes()
```

```ruby
require 'openapi_client'

OpenapiClient.configure do |config|
   
  config.host = 'api.riskrecon.com'

  # It is assumed here that the BEARER_TOKEN is set as an environment variable but you can retrieve it any way you like.

  config.access_token = ENV['BEARER_TOKEN']
end

# Call the `GET Security Criteria Display Names` API.

api_instance = OpenapiClient::DisplayNameApi.new
criteria_display_names = api_instance.get_criteria_display_names
```

```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.ActionPlansApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.riskrecon.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    ActionPlansApi apiInstance = new ActionPlansApi(defaultClient);
    String toeId = "5976423a-ee35-11e3-8569-14109ff1a304"; // String | Filter by the Toe ID.
    try {
      List<ActionPlanIssueProgress> result = apiInstance.actionPlanIssueProgress(toeId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionPlansApi#actionPlanIssueProgress");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

```javascript
var RiskreconApi = require('riskrecon_api');

var defaultClient = new RiskreconApi.ApiClient();
defaultClient.basePath = 'https://api.riskrecon.com'
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"

var api = new RiskreconApi.ActionPlansApi()
var toeId = 5976423a-ee35-11e3-8569-14109ff1a304; // {String} Filter by the Toe ID.
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.actionPlanIssueProgress(toeId, callback);
```

## Use the API Client in Sandbox {#use-the-api-client-in-sandbox}

Follow the instructions in the README.md file of the generated client to install and call APIs from it.

You should find the README.md file in the root directory of the generated client.

Here are some examples of calling APIs in the sandbox environment from a Python, Elixir, Java, and Ruby client:
* Python
* Ruby
* Java
* Javascript

```python
import os
import openapi_client

configuration = openapi_client.Configuration(

    # The host defaults to the sandbox environment and you may choose to skip setting this variable.

    host = "https://api.sandbox.riskrecon.com",

    # It is assumed here that the BEARER_TOKEN is set as an environment variable but you can retrieve it any way you like.
    access_token = os.environ["BEARER_TOKEN"]
)

# Call the `GET_TOES` API.

api_client = openapi_client.ApiClient(configuration)
toes_api_instance = openapi_client.TargetOfEvaluationTOEApi(api_client)
api_response = toes_api_instance.get_toes()
```

```ruby
require 'openapi_client'

OpenapiClient.configure do |config|
  # The host defaults to the sandbox environment and you may choose to skip setting this variable.
  
  config.host = 'api.sandbox.riskrecon.com'

  # It is assumed here that the BEARER_TOKEN is set as an environment variable but you can retrieve it any way you like.

  config.access_token = ENV['BEARER_TOKEN']
end

# Call the `GET Security Criteria Display Names` API.

api_instance = OpenapiClient::DisplayNameApi.new
criteria_display_names = api_instance.get_criteria_display_names
```

```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.ActionPlansApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sandbox.riskrecon.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    ActionPlansApi apiInstance = new ActionPlansApi(defaultClient);
    String toeId = "5976423a-ee35-11e3-8569-14109ff1a304"; // String | Filter by the Toe ID.
    try {
      List<ActionPlanIssueProgress> result = apiInstance.actionPlanIssueProgress(toeId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionPlansApi#actionPlanIssueProgress");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

```javascript
var RiskreconApi = require('riskrecon_api');

var defaultClient = new RiskreconApi.ApiClient();
defaultClient.basePath = 'https://api.sandbox.riskrecon.com'
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"

var api = new RiskreconApi.ActionPlansApi()
var toeId = 5976423a-ee35-11e3-8569-14109ff1a304; // {String} Filter by the Toe ID.
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.actionPlanIssueProgress(toeId, callback);
```

