Skip to content

Commit

Permalink
documented item APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanoo committed Aug 25, 2020
1 parent 83a4420 commit c978063
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 18 deletions.
66 changes: 51 additions & 15 deletions docs.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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'
];
```



12 changes: 9 additions & 3 deletions sdk/ApiSdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c978063

Please sign in to comment.