Skip to content

Latest commit

 

History

History
205 lines (138 loc) · 7.2 KB

BatchApi.md

File metadata and controls

205 lines (138 loc) · 7.2 KB

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
batchJobListWithHttpInfo GET /batch.job.list.json batch.job.list
batchJobResult GET /batch.job.result.json batch.job.result
batchJobResultWithHttpInfo GET /batch.job.result.json batch.job.result

batchJobList

batchJobList(batchJobListRequest): ApiRequest[ModelResponseBatchJobList]

batch.job.list

Get list of recent jobs

Example

// Import classes:
import 
import org.openapitools.client.core._
import org.openapitools.client.core.CollectionFormats._
import org.openapitools.client.core.ApiKeyLocations._

import akka.actor.ActorSystem
import scala.concurrent.Future
import scala.util.{Failure, Success}

object Example extends App {
    
    implicit val system: ActorSystem = ActorSystem()
    import system.dispatcher
    
    // Configure API key authorization: StoreKeyAuth
    implicit val StoreKeyAuth: ApiKeyValue = ApiKeyValue("YOUR API KEY")

    // Configure API key authorization: ApiKeyAuth
    implicit val ApiKeyAuth: ApiKeyValue = ApiKeyValue("YOUR API KEY")

    val apiInvoker = ApiInvoker()
    val apiInstance = BatchApi("https://api.api2cart.com/v1.1")
    val count: Int = 20 // Int | This parameter sets the entity amount that has to be retrieved. Max allowed count=250

    val pageCursor: String =  // String | Used to retrieve entities via cursor-based pagination (it can't be used with any other filtering parameter)

    val createdFrom: String = 2010-07-29 13:45:52 // String | Retrieve entities from their creation date

    val createdTo: String = 2100-08-29 13:45:52 // String | Retrieve entities to their creation date

    val processedFrom: String = 2100-08-29 13:45:52 // String | Retrieve entities according to their processing datetime

    val processedTo: String = 2100-08-29 13:45:52 // String | Retrieve entities according to their processing datetime

    val ids: String = 24,25 // String | Filter batch jobs by ids

    val responseFields: String = {result} // String | Set this parameter in order to choose which entity fields you want to retrieve
    
    val request = apiInstance.batchJobList(count, pageCursor, createdFrom, createdTo, processedFrom, processedTo, ids, responseFields)
    val response = apiInvoker.execute(request)

    response.onComplete {
        case Success(ApiResponse(code, content, headers)) =>
            System.out.println(s"Status code: $code}")
            System.out.println(s"Response headers: ${headers.mkString(", ")}")
            System.out.println(s"Response body: $content")
        
        case Failure(error @ ApiError(code, message, responseContent, cause, headers)) =>
            System.err.println("Exception when calling BatchApi#batchJobList")
            System.err.println(s"Status code: $code}")
            System.err.println(s"Reason: $responseContent")
            System.err.println(s"Response headers: ${headers.mkString(", ")}")
            error.printStackTrace();

        case Failure(exception) => 
            System.err.println("Exception when calling BatchApi#batchJobList")
            exception.printStackTrace();
    }
}

Parameters

Name Type Description Notes
count Int This parameter sets the entity amount that has to be retrieved. Max allowed count=250 [optional]
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]

Return type

ApiRequest[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 -

batchJobResult

batchJobResult(batchJobResultRequest): ApiRequest[ResponseBatchJobResult]

batch.job.result

Get job result data

Example

// Import classes:
import 
import org.openapitools.client.core._
import org.openapitools.client.core.CollectionFormats._
import org.openapitools.client.core.ApiKeyLocations._

import akka.actor.ActorSystem
import scala.concurrent.Future
import scala.util.{Failure, Success}

object Example extends App {
    
    implicit val system: ActorSystem = ActorSystem()
    import system.dispatcher
    
    // Configure API key authorization: StoreKeyAuth
    implicit val StoreKeyAuth: ApiKeyValue = ApiKeyValue("YOUR API KEY")

    // Configure API key authorization: ApiKeyAuth
    implicit val ApiKeyAuth: ApiKeyValue = ApiKeyValue("YOUR API KEY")

    val apiInvoker = ApiInvoker()
    val apiInstance = BatchApi("https://api.api2cart.com/v1.1")
    val id: String = 10 // String | Entity id
    
    val request = apiInstance.batchJobResult(id)
    val response = apiInvoker.execute(request)

    response.onComplete {
        case Success(ApiResponse(code, content, headers)) =>
            System.out.println(s"Status code: $code}")
            System.out.println(s"Response headers: ${headers.mkString(", ")}")
            System.out.println(s"Response body: $content")
        
        case Failure(error @ ApiError(code, message, responseContent, cause, headers)) =>
            System.err.println("Exception when calling BatchApi#batchJobResult")
            System.err.println(s"Status code: $code}")
            System.err.println(s"Reason: $responseContent")
            System.err.println(s"Response headers: ${headers.mkString(", ")}")
            error.printStackTrace();

        case Failure(exception) => 
            System.err.println("Exception when calling BatchApi#batchJobResult")
            exception.printStackTrace();
    }
}

Parameters

Name Type Description Notes
id String Entity id

Return type

ApiRequest[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 -