Dokumentacja API

Default

availability

Pobierz dane o stanie magazynowym

Endpoint umożliwiający pobranie danych o stanie magazynowym, z uwzględnieniem zamówień oraz rezerwacji.


/restapi/api.php

Usage and SDK Samples

curl -X GET\
-H "X-API-KEY: [[apiKey]]"\
-H "Accept: application/json"\
"http://localhost/restapi/api.php?endpoint=&code=&warehouse="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    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");

        DefaultApi apiInstance = new DefaultApi();
        String endpoint = endpoint_example; // String | Nazwa endpointu
        String code = code_example; // String | Kod towaru
        String warehouse = warehouse_example; // String | Symbol magazynu
        try {
            apiInstance.availability(endpoint, code, warehouse);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#availability");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String endpoint = endpoint_example; // String | Nazwa endpointu
        String code = code_example; // String | Kod towaru
        String warehouse = warehouse_example; // String | Symbol magazynu
        try {
            apiInstance.availability(endpoint, code, warehouse);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#availability");
            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"];
String *endpoint = endpoint_example; // Nazwa endpointu
String *code = code_example; // Kod towaru
String *warehouse = warehouse_example; // Symbol magazynu (optional)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Pobierz dane o stanie magazynowym
[apiInstance availabilityWith:endpoint
    code:code
    warehouse:warehouse
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var DokumentacjaApi = require('dokumentacja_api');
var defaultClient = DokumentacjaApi.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"

var api = new DokumentacjaApi.DefaultApi()
var endpoint = endpoint_example; // {{String}} Nazwa endpointu
var code = code_example; // {{String}} Kod towaru
var opts = { 
  'warehouse': warehouse_example // {{String}} Symbol magazynu
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.availability(endpoint, code, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class availabilityExample
    {
        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");

            var apiInstance = new DefaultApi();
            var endpoint = endpoint_example;  // String | Nazwa endpointu
            var code = code_example;  // String | Kod towaru
            var warehouse = warehouse_example;  // String | Symbol magazynu (optional) 

            try
            {
                // Pobierz dane o stanie magazynowym
                apiInstance.availability(endpoint, code, warehouse);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.availability: " + 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');

$api_instance = new Swagger\Client\ApiDefaultApi();
$endpoint = endpoint_example; // String | Nazwa endpointu
$code = code_example; // String | Kod towaru
$warehouse = warehouse_example; // String | Symbol magazynu

try {
    $api_instance->availability($endpoint, $code, $warehouse);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->availability: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

# 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";

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $endpoint = endpoint_example; # String | Nazwa endpointu
my $code = code_example; # String | Kod towaru
my $warehouse = warehouse_example; # String | Symbol magazynu

eval { 
    $api_instance->availability(endpoint => $endpoint, code => $code, warehouse => $warehouse);
};
if ($@) {
    warn "Exception when calling DefaultApi->availability: $@\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'

# create an instance of the API class
api_instance = swagger_client.DefaultApi()
endpoint = endpoint_example # String | Nazwa endpointu
code = code_example # String | Kod towaru
warehouse = warehouse_example # String | Symbol magazynu (optional)

try: 
    # Pobierz dane o stanie magazynowym
    api_instance.restapi_api_php_get(endpoint, code, warehouse=warehouse)
except ApiException as e:
    print("Exception when calling DefaultApi->availability: %s\n" % e)

Parameters

Query parameters
Name Description
endpoint*
String
Nazwa endpointu (domyślnie: availability)
Required
code*
String
Kod towaru
Required
warehouse
String
Symbol magazynu

Responses

Status: 200 - Udane zapytanie

{
  "dane": [
    {
      "Twr_Nazwa": "Metalowa szafa aktowa 80 CM",
      "TwG_Kod": "MAG EAN",
      "Mag_Symbol": "MAGAZYN-KRAKOW",
      "TwI_Ilosc": 48,
      "TwI_Rezerwacje": 12,
      "TwI_Zamowienia": 1
    },
    {
      "Twr_Nazwa": "Metalowa szafa aktowa 80 CM",
      "TwG_Kod": "MAG EAN",
      "Mag_Symbol": "MAGAZYN-WARSZAWA",
      "TwI_Ilosc": 33,
      "TwI_Rezerwacje": 2,
      "TwI_Zamowienia": 5
    }
  ]
}