Skip to content

Commit 9f741e9

Browse files
committed
Formalise private API endpoints.
1 parent 5897e91 commit 9f741e9

File tree

4 files changed

+57
-11
lines changed

4 files changed

+57
-11
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,5 @@ $api->pvpteam->get($id, $data = []);
137137
$api->pvpteam->update($id);
138138
$api->pvpteam->delete($id);
139139
```
140+
141+
> Note: The `_private` API is for internal use within XIVAPI and MogBoard. It cannot be used publicly and is locked behind an access key.

src/XIVAPI/Api/Market.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,4 @@ public function categories()
6666
{
6767
return Guzzle::get("/market/categories");
6868
}
69-
70-
public function manualUpdateItem(string $accessKey, int $itemId, int $server)
71-
{
72-
return Guzzle::get("/private/market/item/update", [
73-
RequestOptions::QUERY => [
74-
'access' => $accessKey,
75-
'item_id' => $itemId,
76-
'server' => $server,
77-
]
78-
]);
79-
}
8069
}

src/XIVAPI/Api/PrivateApi.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace XIVAPI\Api;
4+
5+
use GuzzleHttp\RequestOptions;
6+
use XIVAPI\Guzzle\Guzzle;
7+
8+
class PrivateApi
9+
{
10+
/**
11+
* Request an item to be updated
12+
*/
13+
public function manualItemUpdate(string $accessKey, int $itemId, string $server)
14+
{
15+
return Guzzle::get("/private/market/item/update", [
16+
RequestOptions::QUERY => [
17+
'companion_access_key' => $accessKey,
18+
'item_id' => $itemId,
19+
'server' => $server,
20+
]
21+
]);
22+
}
23+
24+
/**
25+
* Request an item to be updated
26+
*/
27+
public function itemPrices(string $accessKey, int $itemId, string $server)
28+
{
29+
return Guzzle::get("/private/market/item", [
30+
RequestOptions::QUERY => [
31+
'companion_access_key' => $accessKey,
32+
'item_id' => $itemId,
33+
'server' => $server,
34+
]
35+
]);
36+
}
37+
38+
/**
39+
* Request an item to be updated
40+
*/
41+
public function itemHistory(string $accessKey, int $itemId, string $server)
42+
{
43+
return Guzzle::get("/private/market/item/history", [
44+
RequestOptions::QUERY => [
45+
'companion_access_key' => $accessKey,
46+
'item_id' => $itemId,
47+
'server' => $server,
48+
]
49+
]);
50+
}
51+
}

src/XIVAPI/XIVAPI.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use XIVAPI\Api\Lodestone;
1010
use XIVAPI\Api\Market;
1111
use XIVAPI\Api\PatchList;
12+
use XIVAPI\Api\PrivateApi;
1213
use XIVAPI\Api\PvPTeam;
1314
use XIVAPI\Api\Search;
1415
use XIVAPI\Api\Content;
@@ -44,6 +45,8 @@ class XIVAPI
4445
public $market;
4546
/** @var PatchList */
4647
public $patchlist;
48+
/** @var PrivateApi */
49+
public $_private;
4750

4851
public function __construct(string $environment = self::PROD)
4952
{
@@ -61,6 +64,7 @@ public function __construct(string $environment = self::PROD)
6164
$this->lodestone = new Lodestone();
6265
$this->market = new Market();
6366
$this->patchlist = new PatchList();
67+
$this->_private = new PrivateApi();
6468
}
6569

6670
public function reset(): XIVAPI

0 commit comments

Comments
 (0)