Skip to content

Commit 470a9ba

Browse files
committed
API-1860: Replace ProductApi with ProductUuidApi in relevant API Client snippets
1 parent 7c2e545 commit 470a9ba

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

content/php-client/exception.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can get the request and the response that are responsible for this exception
1111

1212
```php
1313
try {
14-
$client->getProductApi()->get('top');
14+
$client->getProductUuidApi()->get('1cf1d135-26fe-4ac2-9cf5-cdb69ada0547');
1515
} catch (HttpException $e) {
1616
// do your stuff with the exception
1717
$requestBody = $e->getRequest()->getBody();
@@ -80,7 +80,7 @@ It returns an empty array if there is no error in the array.
8080

8181
```php
8282
try {
83-
$client->getProductApi()->create('top');
83+
$client->getProductUuidApi()->create('1cf1d135-26fe-4ac2-9cf5-cdb69ada0547');
8484
} catch (UnprocessableEntityHttpException $e) {
8585
// do your stuff with the exception
8686
$requestBody = $e->getRequest()->getBody();
@@ -103,7 +103,7 @@ It corresponds to the HTTP code 429.
103103

104104
```php
105105
try {
106-
$client->getProductApi()->get('top');
106+
$client->getProductUuidApi()->get('1cf1d135-26fe-4ac2-9cf5-cdb69ada0547');
107107
} catch (TooManyRequestsHttpException $e) {
108108
$requestBody = $e->getRequest()->getBody();
109109
$responseBody = $e->getResponse()->getBody();

content/php-client/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Want to know more about authentication? It's over [there](/php-client/authentica
8787
Getting a product is as simple as:
8888

8989
```
90-
$product = $client->getProductApi()->get('top');
91-
echo $product['identifier'];
90+
$product = $client->getProductUuidApi()->get('1cf1d135-26fe-4ac2-9cf5-cdb69ada0547');
91+
echo $product['uuid'];
9292
```
9393

9494
Want to [update an attribute](/php-client/resources.html#upsert-an-attribute), [create a category](/php-client/resources.html#create-a-category) or [delete a product](/php-client/resources.html#delete-a-product)? You can get code snippets for all the resources [here](/php-client/resources.html)

content/php-client/list-resources.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ You can define the first parameter `page size` to adjust the number of resources
1616

1717
```php
1818

19-
$products = $client->getProductApi()->all(50);
19+
$products = $client->getProductUuidApi()->all(50);
2020
foreach ($products as $product) {
2121
// do your stuff here
22-
echo $product['identifier'];
22+
echo $product['uuid'];
2323
}
2424
```
2525

@@ -39,7 +39,7 @@ This method allows to get a list of resources page per page, as a classical pagi
3939
You get the first page by calling the function `listPerpage`. The first parameter `limit` is the number of elements per page.
4040

4141
```php
42-
$firstPage = $client->getProductApi()->listPerPage(50);
42+
$firstPage = $client->getProductUuidApi()->listPerPage(50);
4343
```
4444

4545
::: warning
@@ -50,7 +50,7 @@ Then, you can iterate the items of this page:
5050
```php
5151
foreach ($firstPage->getItems() as $product) {
5252
// do your stuff here
53-
echo $product['identifier'];
53+
echo $product['uuid'];
5454
}
5555
```
5656

0 commit comments

Comments
 (0)