diff --git a/app/DotsAPI/Fetcher/v2/ApiFetcher.php b/app/DotsAPI/Fetcher/v2/ApiFetcher.php new file mode 100644 index 0000000..c025725 --- /dev/null +++ b/app/DotsAPI/Fetcher/v2/ApiFetcher.php @@ -0,0 +1,38 @@ +get( + $apiUrl, + [ + 'headers' => [ + 'Api-Token' => $apiToken, + 'Api-Account-Token' => $apiAccountToken, + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ], + 'query' => [ + 'v'=> '2.0.0', + ], + ] + ); + + $data = json_decode($response->getBody()->getContents(), true); + $items = $data['items']; + + return $items; + } +}