GET
/api/v2/products/{product}
v2
No authentication required.
Full URL: https://api.acme.example/api/v2/products/{product}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| product | integer | yes | The product id. |
Responses
200 The product.
404 No product with that id.
Example request
curl -X GET 'https://api.acme.example/api/v2/products/1' \
-H 'Accept: application/json'
const response = await fetch('https://api.acme.example/api/v2/products/1', {
method: 'GET',
headers: {
'Accept': 'application/json'
}
});
const data = await response.json();
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Accept' => 'application/json',
])->get('https://api.acme.example/api/v2/products/1');
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.acme.example/api/v2/products/1', [
'headers' => [
'Accept' => 'application/json',
],
]);
$data = json_decode((string) $response->getBody(), true);