diff --git a/docs.md b/docs.md index 4d3fc3f..fad4d68 100644 --- a/docs.md +++ b/docs.md @@ -1,20 +1,12 @@ -### Searching for an item +Documentation +=== + +## Table of contents +* [User Accounts & Passwords]() +* [Addresses]() +* [Items]() -**POST** **```/api/v2/items```** is mapped to `$sdk->getAllItemsJsonFiltering();` -```php -$data = [ - 'keywords' => 'string', - 'pagesize' => 'string', - 'Categories' =>[ - 'string' - ], - 'sellerID' => 'string' -]; -$response = $sdk->getAllItemsJsonFiltering($data); -$results = $response['Records']; //The actual array of matching items is in the "Records" field of the JSON response -``` ---- ## User Accounts ### Get A User's details @@ -508,3 +500,47 @@ Arguments: Documentation and `$data` details can be found [here](https://apiv2.arcadier.com/#8af9bf27-a3fb-4623-b8d0-f53a67697c47). + +### Delete Item/Listing/Booking +**DELETE ``/api/v2/merchants/{{merchantID}}/items/{{itemID}}``** is mapped to `deleteItem($merchantId, $itemId)` + +Arguments: +* `$merchantId` - *(Required)* Merchant GUID (string) +* `$itemId` - *(Required)* Item GUID (string) + +### Tag Item/Listing/Booking +**POST ``/api/v2/merchants/{{merchantID}}/items/{{itemID}}/tags``** is mapped to `tagItem($data, $merchantId, $itemId)` + +Arguments: +* `$merchantId` - *(Required)* Merchant GUID (string) +* `$itemId` - *(Required)* Item GUID (string) +* `$data` - Item details (Array of strings) + +```php +$data = [ + 'string', + 'string' +]; +``` + +### Get Item Tags +**GET ``/api/v2/tags``** is mapped to `getItemTags($pageSize = null, $pageNumber = null)` + +Arguments: +* `$pageSize` - *(Optional)* Number of results per page (integer) +* `$pageNumber` - *(Optional)* Page number (integer) + +More about pagination [here](https://apiv2.arcadier.com/#pagination) + +### Delete Tags +**DELETE ``/api/v2/tags``** is mapped to `deleteTags($data)` + +```php +$data = [ + 'string', + 'string' +]; +``` + + + diff --git a/sdk/ApiSdk.php b/sdk/ApiSdk.php index 4f2d3b3..176d4a0 100644 --- a/sdk/ApiSdk.php +++ b/sdk/ApiSdk.php @@ -341,14 +341,20 @@ public function deleteItem($merchantId, $itemId) return $deletedItem; } - public function getItemTags($filterParams) + public function getItemTags($pageSize = null, $pageNumber = null) { if ($this->adminToken == null) { $this->adminToken = $this->getAdminToken(); } $url = $this->baseUrl . '/api/v2/tags/'; - if ($filterParams != null) { - $url .= $filterParams; + if ($pageSize != null && $pageNumber != null) { + $url .= '?pageSize='.$pageSize.'&pageNumber='.$pageNumber; + } + if ($pageSize != null && $pageNumber == null) { + $url .= '?pageSize='.$pageSize; + } + if ($pageSize == null && $pageNumber != null) { + $url .= '?pageNumber='.$pageNumber; } $tags = $this->callAPI("GET", $this->adminToken['access_token'], $url, false); return $tags;