calculateAlcohol
Return the amount of alcohol (in gramm) contained in a drink. Given a drink with a volume (ml) containing percent (vol/vol) alcohol.
/apitalk/blood-alcohol-api/calculate_alcohol/
Usage and SDK Samples
curl -X POST "https://api.apieco.ir/apitalk/blood-alcohol-api/calculate_alcohol/"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CalculateApi;
import java.io.File;
import java.util.*;
public class CalculateApiExample {
public static void main(String[] args) {
CalculateApi apiInstance = new CalculateApi();
String apiecoKey = apiecoKey_example; // String | apikey for use API
Integer percent = 56; // Integer | your percent
Integer volume = 56; // Integer | your volume
try {
result result = apiInstance.calculateAlcohol(apiecoKey, percent, volume);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CalculateApi#calculateAlcohol");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CalculateApi;
public class CalculateApiExample {
public static void main(String[] args) {
CalculateApi apiInstance = new CalculateApi();
String apiecoKey = apiecoKey_example; // String | apikey for use API
Integer percent = 56; // Integer | your percent
Integer volume = 56; // Integer | your volume
try {
result result = apiInstance.calculateAlcohol(apiecoKey, percent, volume);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CalculateApi#calculateAlcohol");
e.printStackTrace();
}
}
}
String *apiecoKey = apiecoKey_example; // apikey for use API
Integer *percent = 56; // your percent
Integer *volume = 56; // your volume
CalculateApi *apiInstance = [[CalculateApi alloc] init];
// Return the amount of alcohol (in gramm) contained in a drink.
Given a drink with a volume (ml) containing percent (vol/vol) alcohol.
[apiInstance calculateAlcoholWith:apiecoKey
percent:percent
volume:volume
completionHandler: ^(result output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var BloodAlcoholApi = require('blood_alcohol_api');
var api = new BloodAlcoholApi.CalculateApi()
var apiecoKey = apiecoKey_example; // {String} apikey for use API
var percent = 56; // {Integer} your percent
var volume = 56; // {Integer} your volume
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.calculateAlcohol(apiecoKey, percent, volume, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class calculateAlcoholExample
{
public void main()
{
var apiInstance = new CalculateApi();
var apiecoKey = apiecoKey_example; // String | apikey for use API
var percent = 56; // Integer | your percent
var volume = 56; // Integer | your volume
try
{
// Return the amount of alcohol (in gramm) contained in a drink.
Given a drink with a volume (ml) containing percent (vol/vol) alcohol.
result result = apiInstance.calculateAlcohol(apiecoKey, percent, volume);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CalculateApi.calculateAlcohol: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\CalculateApi();
$apiecoKey = apiecoKey_example; // String | apikey for use API
$percent = 56; // Integer | your percent
$volume = 56; // Integer | your volume
try {
$result = $api_instance->calculateAlcohol($apiecoKey, $percent, $volume);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CalculateApi->calculateAlcohol: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CalculateApi;
my $api_instance = WWW::SwaggerClient::CalculateApi->new();
my $apiecoKey = apiecoKey_example; # String | apikey for use API
my $percent = 56; # Integer | your percent
my $volume = 56; # Integer | your volume
eval {
my $result = $api_instance->calculateAlcohol(apiecoKey => $apiecoKey, percent => $percent, volume => $volume);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CalculateApi->calculateAlcohol: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.CalculateApi()
apiecoKey = apiecoKey_example # String | apikey for use API
percent = 56 # Integer | your percent
volume = 56 # Integer | your volume
try:
# Return the amount of alcohol (in gramm) contained in a drink.
Given a drink with a volume (ml) containing percent (vol/vol) alcohol.
api_response = api_instance.calculate_alcohol(apiecoKey, percent, volume)
pprint(api_response)
except ApiException as e:
print("Exception when calling CalculateApi->calculateAlcohol: %s\n" % e)
Parameters
Name | Description |
---|---|
apieco-key* |
String
apikey for use API
Required
|
Name | Description |
---|---|
percent* |
Integer
your percent
Required
|
volume* |
Integer
your volume
Required
|