Skip to content

Latest commit

 

History

History
executable file
·
257 lines (179 loc) · 7.79 KB

File metadata and controls

executable file
·
257 lines (179 loc) · 7.79 KB

WalletPassJP\AssetsApi

All URIs are relative to https://walletpass.jp/api/v1

Method HTTP request Description
deleteAsset DELETE /assets/{asset} Delete Asset
getAssetByID GET /assets/{asset} Get Asset by ID
listAssets GET /assets Get all assets
updateAsset PATCH /assets/{asset} Update Asset
uploadAsset POST /assets Upload an asset

deleteAsset

deleteAsset($asset)

Delete Asset

Delete an asset.

Example

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Configure HTTP bearer authorization: Bearer
$key = 'YOUR_ACCESS_TOKEN';

$apiInstance = new WalletPassJP\Api\AssetsApi($key);
$asset_id = 'asset_example'; // Asset ID

try {
    $apiInstance->delete($asset_id);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->deleteAsset: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
asset string Asset ID

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

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

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

getAssetByID

\WalletPassJP\Model\Asset getAssetByID($asset)

Get Asset by ID

Get Asset record.

Example

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Configure HTTP bearer authorization: Bearer
$key = 'YOUR_ACCESS_TOKEN';

$apiInstance = new WalletPassJP\Api\AssetsApi($key);
$asset_id = 'asset_example'; // Asset ID

try {
    $result = $apiInstance->show($asset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->getAssetByID: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
asset string Asset ID

Return type

\WalletPassJP\Model\Asset

Authorization

Bearer

HTTP request headers

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

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

listAssets

\WalletPassJP\Model\CollectionResponse listAssets($limit, $page, $tags)

Get all assets

Get all Assets records.

Example

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Configure HTTP bearer authorization: Bearer
$key = 'YOUR_ACCESS_TOKEN';

$apiInstance = new WalletPassJP\Api\AssetsApi($key);
$limit = 15; // int | Records imit
$page = 1; // int | Page number
$tags = ['tags_example']; // string[] | Filter by tags

try {
    $result = $apiInstance->list($limit, $page, $tags);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->listAssets: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
limit int Records imit [optional] [default to 15]
page int Page number [optional] [default to 1]
tags string[] Filter by tags [optional]

Return type

\WalletPassJP\Model\CollectionResponse

Authorization

Bearer

HTTP request headers

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

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

updateAsset

updateAsset($asset, $body)

Update Asset

Use to attach tags to an Asset.

Example

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Configure HTTP bearer authorization: Bearer
$key = 'YOUR_ACCESS_TOKEN';

$apiInstance = new WalletPassJP\Api\AssetsApi($key);
$asset_id = 'asset_example'; // Asset ID
$body = new \WalletPassJP\Model\Body1(); // \WalletPassJP\Model\Body1 |

try {
    $apiInstance->update($asset, $body);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->updateAsset: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
asset string Asset ID
body \WalletPassJP\Model\Body1 [optional]

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

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

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

uploadAsset

\WalletPassJP\Model\Asset uploadAsset($file, $type, $name, $tags)

Upload an asset

| Asset Type | Used in | Dimensions |---------------|----------------------------------|----------------------------------| | icon | Required for all types of Apple passes | 87x87 | logo | Must be square. Logo is circle-cropped by Google Pay | 660x660, a 15% safety margin is recommended | apple_logo | Can be used for Apple passes without logo_text and where square logo is unwanted (FIXME) | maximum 480x150 | strip | Coupon, Gift Card, Event Ticket, Stamp and Membership Card. Used as hero in Google Pay and in the dialog box when installing a pass | 1125x294 for Event Tickets or 1125x369 for other types of passes | thumbnail | Event tickets and Membership Cards | 270x270 The aspect ratio should be in the range of 2:3 to 3:2, otherwise the image is cropped | background | Only for Event Tickets | 360x440 | footer | Only for Boarding Passes | 858x45 Preferred image format is png since it supports transparency. Maximum upload size is 1 Megabyte (1024 Kb). Reference * Google Pay, brand guideline * Apple Wallet, pass design guide

Example

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Configure HTTP bearer authorization: Bearer
$key = 'YOUR_ACCESS_TOKEN';

$apiInstance = new WalletPassJP\Api\AssetsApi($key);
$file = 'file_example'; // string |
$type = 'type_example'; // string |
$name = 'name_example'; // string |
$tags = ['tags_example']; // string[] |

try {
    $result = $apiInstance->upload($file, $type, $name, $tags);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->uploadAsset: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
file string [optional]
type string [optional]
name string [optional]
tags string[] [optional]

Return type

\WalletPassJP\Model\Asset

Authorization

Bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

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