apiLockPost
Start a transaction by locking a vending machine.
/api/lock
Usage and SDK Samples
curl -X POST\
-H "X-API-Key: [[apiKey]]"\
-H "Authorization: Basic [[basicHash]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://api.connectivity.REGION.vendingontrack.com/connectivity-platform/api/lock"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PaymentEndpointApi;
import java.io.File;
import java.util.*;
public class PaymentEndpointApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");
PaymentEndpointApi apiInstance = new PaymentEndpointApi();
LockRequest body = ; // LockRequest |
try {
LockResponse result = apiInstance.apiLockPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentEndpointApi#apiLockPost");
e.printStackTrace();
}
}
}
import io.swagger.client.api.PaymentEndpointApi;
public class PaymentEndpointApiExample {
public static void main(String[] args) {
PaymentEndpointApi apiInstance = new PaymentEndpointApi();
LockRequest body = ; // LockRequest |
try {
LockResponse result = apiInstance.apiLockPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentEndpointApi#apiLockPost");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: ApiKeyAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-Key"];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
LockRequest *body = ; //
PaymentEndpointApi *apiInstance = [[PaymentEndpointApi alloc] init];
// Start a transaction by locking a vending machine.
[apiInstance apiLockPostWith:body
completionHandler: ^(LockResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var VendingMachineApiDocumentConnectivityPlatformVendingOnTrack = require('vending_machine_api_document___connectivity_platform___vending_on_track');
var defaultClient = VendingMachineApiDocumentConnectivityPlatformVendingOnTrack.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-Key'] = "Token"
// Configure HTTP basic authorization: BasicAuth
var BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME'
BasicAuth.password = 'YOUR PASSWORD'
var api = new VendingMachineApiDocumentConnectivityPlatformVendingOnTrack.PaymentEndpointApi()
var body = ; // {{LockRequest}}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.apiLockPost(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class apiLockPostExample
{
public void main()
{
// Configure API key authorization: ApiKeyAuth
Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer"); // Configure HTTP basic authorization: BasicAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
var apiInstance = new PaymentEndpointApi();
var body = new LockRequest(); // LockRequest |
try
{
// Start a transaction by locking a vending machine.
LockResponse result = apiInstance.apiLockPost(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PaymentEndpointApi.apiLockPost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');// Configure HTTP basic authorization: BasicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Swagger\Client\ApiPaymentEndpointApi();
$body = ; // LockRequest |
try {
$result = $api_instance->apiLockPost($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentEndpointApi->apiLockPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PaymentEndpointApi;
# Configure API key authorization: ApiKeyAuth
$WWW::SwaggerClient::Configuration::api_key->{'X-API-Key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-API-Key'} = "Bearer";# Configure HTTP basic authorization: BasicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
my $api_instance = WWW::SwaggerClient::PaymentEndpointApi->new();
my $body = WWW::SwaggerClient::Object::LockRequest->new(); # LockRequest |
eval {
my $result = $api_instance->apiLockPost(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PaymentEndpointApi->apiLockPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
swagger_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'# Configure HTTP basic authorization: BasicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.PaymentEndpointApi()
body = # LockRequest |
try:
# Start a transaction by locking a vending machine.
api_response = api_instance.api_lock_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling PaymentEndpointApi->apiLockPost: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |