Skip to content

Latest commit

 

History

History
169 lines (114 loc) · 5.4 KB

File metadata and controls

169 lines (114 loc) · 5.4 KB

Swappy\BulkApi

All URIs are relative to https://api.swappy.com/

Method HTTP request Description
createBulkJob POST /v1/bulkjobs
getBulkJob GET /v1/bulkjobs/{id}
getBulkJobResult GET /v1/bulkjobs/{id}/results

createBulkJob

\Swappy\Api\Model\BulkJob createBulkJob($body, $language)

Start a bulk product job

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth
Swappy\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swappy\Api\BulkApi();
$body = array(new Product()); // \Swappy\Api\Model\Product[] | Product list to be uploaded
$language = "language_example"; // string | Language for the response

try {
    $result = $api_instance->createBulkJob($body, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->createBulkJob: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Swappy\Api\Model\Product[] Product list to be uploaded
language string Language for the response [optional]

Return type

\Swappy\Api\Model\BulkJob

Authorization

oauth

HTTP request headers

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

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

getBulkJob

\Swappy\Api\Model\BulkJob getBulkJob($id, $if_none_match, $if_modified_since, $language)

Get infos about a job

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth
Swappy\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swappy\Api\BulkApi();
$id = 56; // int | Product ID
$if_none_match = "if_none_match_example"; // string | Etag, will return `304 Not Modified` if content hasn't changed
$if_modified_since = new \DateTime(); // \DateTime | Will return `304 Not Modified` if content hasn't changed
$language = "language_example"; // string | Language for the response

try {
    $result = $api_instance->getBulkJob($id, $if_none_match, $if_modified_since, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->getBulkJob: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int Product ID
if_none_match string Etag, will return `304 Not Modified` if content hasn't changed [optional]
if_modified_since \DateTime Will return `304 Not Modified` if content hasn't changed [optional]
language string Language for the response [optional]

Return type

\Swappy\Api\Model\BulkJob

Authorization

oauth

HTTP request headers

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

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

getBulkJobResult

\Swappy\Api\Model\BulkJobResult[] getBulkJobResult($id, $if_none_match, $if_modified_since, $language)

Get results for a job

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth
Swappy\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swappy\Api\BulkApi();
$id = 56; // int | Product ID
$if_none_match = "if_none_match_example"; // string | Etag, will return `304 Not Modified` if content hasn't changed
$if_modified_since = new \DateTime(); // \DateTime | Will return `304 Not Modified` if content hasn't changed
$language = "language_example"; // string | Language for the response

try {
    $result = $api_instance->getBulkJobResult($id, $if_none_match, $if_modified_since, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->getBulkJobResult: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int Product ID
if_none_match string Etag, will return `304 Not Modified` if content hasn't changed [optional]
if_modified_since \DateTime Will return `304 Not Modified` if content hasn't changed [optional]
language string Language for the response [optional]

Return type

\Swappy\Api\Model\BulkJobResult[]

Authorization

oauth

HTTP request headers

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

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