Skip to content

Latest commit

 

History

History
223 lines (180 loc) · 8.66 KB

BatchApi.md

File metadata and controls

223 lines (180 loc) · 8.66 KB

Org.OpenAPITools.Api.BatchApi

All URIs are relative to https://api.api2cart.com/v1.1

Method HTTP request Description
BatchJobList GET /batch.job.list.json batch.job.list
BatchJobResult GET /batch.job.result.json batch.job.result

BatchJobList

ModelResponseBatchJobList BatchJobList (int? count = null, string? pageCursor = null, string? createdFrom = null, string? createdTo = null, string? processedFrom = null, string? processedTo = null, string? ids = null, string? responseFields = null)

batch.job.list

Get list of recent jobs

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class BatchJobListExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.api2cart.com/v1.1";
            // Configure API key authorization: StoreKeyAuth
            config.AddApiKey("x-store-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-store-key", "Bearer");
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");

            var apiInstance = new BatchApi(config);
            var count = 20;  // int? | This parameter sets the entity amount that has to be retrieved. Max allowed count=250 (optional)  (default to 10)
            var pageCursor = ;  // string? | Used to retrieve entities via cursor-based pagination (it can't be used with any other filtering parameter) (optional) 
            var createdFrom = 2010-07-29 13:45:52;  // string? | Retrieve entities from their creation date (optional) 
            var createdTo = 2100-08-29 13:45:52;  // string? | Retrieve entities to their creation date (optional) 
            var processedFrom = 2100-08-29 13:45:52;  // string? | Retrieve entities according to their processing datetime (optional) 
            var processedTo = 2100-08-29 13:45:52;  // string? | Retrieve entities according to their processing datetime (optional) 
            var ids = 24,25;  // string? | Filter batch jobs by ids (optional) 
            var responseFields = {result};  // string? | Set this parameter in order to choose which entity fields you want to retrieve (optional)  (default to "{return_code,return_message,pagination,result}")

            try
            {
                // batch.job.list
                ModelResponseBatchJobList result = apiInstance.BatchJobList(count, pageCursor, createdFrom, createdTo, processedFrom, processedTo, ids, responseFields);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BatchApi.BatchJobList: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BatchJobListWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // batch.job.list
    ApiResponse<ModelResponseBatchJobList> response = apiInstance.BatchJobListWithHttpInfo(count, pageCursor, createdFrom, createdTo, processedFrom, processedTo, ids, responseFields);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BatchApi.BatchJobListWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
count int? This parameter sets the entity amount that has to be retrieved. Max allowed count=250 [optional] [default to 10]
pageCursor string? Used to retrieve entities via cursor-based pagination (it can't be used with any other filtering parameter) [optional]
createdFrom string? Retrieve entities from their creation date [optional]
createdTo string? Retrieve entities to their creation date [optional]
processedFrom string? Retrieve entities according to their processing datetime [optional]
processedTo string? Retrieve entities according to their processing datetime [optional]
ids string? Filter batch jobs by ids [optional]
responseFields string? Set this parameter in order to choose which entity fields you want to retrieve [optional] [default to "{return_code,return_message,pagination,result}"]

Return type

ModelResponseBatchJobList

Authorization

StoreKeyAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BatchJobResult

ResponseBatchJobResult BatchJobResult (string id)

batch.job.result

Get job result data

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class BatchJobResultExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.api2cart.com/v1.1";
            // Configure API key authorization: StoreKeyAuth
            config.AddApiKey("x-store-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-store-key", "Bearer");
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");

            var apiInstance = new BatchApi(config);
            var id = 10;  // string | Entity id

            try
            {
                // batch.job.result
                ResponseBatchJobResult result = apiInstance.BatchJobResult(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BatchApi.BatchJobResult: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BatchJobResultWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // batch.job.result
    ApiResponse<ResponseBatchJobResult> response = apiInstance.BatchJobResultWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BatchApi.BatchJobResultWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string Entity id

Return type

ResponseBatchJobResult

Authorization

StoreKeyAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

[Back to top] [Back to API list] [Back to Model list] [Back to README]