curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .StoreApi;
import java.io.File;
import java.util.*;
public class StoreApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
StoreApi apiInstance = new StoreApi();
try {
map['String', 'Integer'] result = apiInstance.getInventory();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#getInventory");
e.printStackTrace();
}
}
}
import .StoreApi;
public class StoreApiExample {
public static void main(String[] args) {
StoreApi apiInstance = new StoreApi();
try {
map['String', 'Integer'] result = apiInstance.getInventory();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#getInventory");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
StoreApi *apiInstance = [[StoreApi alloc] init];
// Returns pet inventories by status
[apiInstance getInventoryWithCompletionHandler:
^(map['String', 'Integer'] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var = require('');
var defaultClient = .ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token"
var api = new .StoreApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getInventory(callback);
using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;
namespace Example
{
public class getInventoryExample
{
public void main()
{
// Configure API key authorization: api_key
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
var apiInstance = new StoreApi();
try
{
// Returns pet inventories by status
map['String', 'Integer'] result = apiInstance.getInventory();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling StoreApi.getInventory: " + e.Message );
}
}
}
}
setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
$api_instance = new io.swagger.client\Api\StoreApi();
try {
$result = $api_instance->getInventory();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
}