You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -217,9 +218,10 @@ In this example, you will retrieve all stories where the "title" field is empty.
217
218
218
219
```php
219
220
use Storyblok\ManagementApi\QueryParameters\Filters\Filter;
221
+
use Storyblok\ManagementApi\Endpoints\StoryBulkApi;
220
222
use Storyblok\ManagementApi\QueryParameters\Filters\QueryFilters;
221
223
222
-
$storyBulkApi = $client->storyBulkApi($spaceId);
224
+
$storyBulkApi = new StoryBulkApi($client, $spaceId);
223
225
$stories = $storyBulkApi->all(
224
226
filters: (new QueryFilters())->add(
225
227
new Filter(
@@ -315,7 +317,7 @@ myslug-003;My Story 3 BULK;page
315
317
Next, you can implement a script to load and parse the CSV file. In this case, we use `SplFileObject` and then call the `createStories` method to process the data:
316
318
317
319
```php
318
-
$storyBulkApi = $client->storyBulkApi($spaceId);
320
+
$storyBulkApi = new StoryBulkApi($client, $spaceId);
319
321
$file = new SplFileObject("stories.csv");
320
322
$file->setFlags(SplFileObject::READ_CSV);
321
323
$file->setCsvControl(separator: ";");
@@ -339,7 +341,7 @@ To get the current user, owner of the Personal access token used you can use the
339
341
340
342
```php
341
343
342
-
$response = $c->userApi()->me();
344
+
$response = new UserApi($client)->me();
343
345
/** @var UserData $currentUser */
344
346
$currentUser = $response->data();
345
347
// "User ID"
@@ -367,15 +369,15 @@ use Storyblok\ManagementApi\ManagementApiClient;
367
369
$client = new ManagementApiClient($storyblokPersonalAccessToken);
368
370
369
371
$spaceId = "spaceid";
370
-
$assetApi = $client->assetApi($spaceId);
372
+
$assetApi = new AssetApi($client, $spaceId);
371
373
```
372
374
373
375
### Getting the assets list
374
376
375
377
To get the assets list you can use the `assetApi` and the `AssetsData`.
376
378
377
379
```php
378
-
$assetApi = $client->assetApi($spaceId);
380
+
$assetApi = new AssetApi($client, $spaceId);
379
381
$response = $assetApi->page();
380
382
/** @var AssetsData $assets */
381
383
$assets = $response->data();
@@ -395,7 +397,7 @@ Using the `AssetsParams` class you can set up filters for filtering the assets.
395
397
```php
396
398
use Storyblok\ManagementApi\QueryParameters\{AssetsParams,PaginationParams};
397
399
398
-
$assetApi = $client->assetApi($spaceId);
400
+
$assetApi = new AssetApi($client, $spaceId);
399
401
$assets = $assetApi->page(
400
402
new AssetsParams(
401
403
inFolder: -1,
@@ -449,7 +451,7 @@ if ($response->isOk()) {
449
451
To delete an asset, you can use the `delete()` method. The `delete()` method requires the asset ID (you want to delete) as parameter:
450
452
451
453
```php
452
-
$assetApi = $c->assetApi($spaceId);
454
+
$assetApi = new AssetApi($client, $spaceId);
453
455
echo "DELETING " . $assetId . PHP_EOL;
454
456
$response = $assetApi->delete($assetId);
455
457
$deletedAsset = $response->data();
@@ -467,7 +469,7 @@ use Storyblok\ManagementApi\ManagementApiClient;
467
469
$client = new ManagementApiClient($storyblokPersonalAccessToken);
468
470
469
471
$spaceId = "spaceid";
470
-
$tagApi = $client->tagApi($spaceId);
472
+
$tagApi = new TagApi($client, $spaceId);
471
473
```
472
474
473
475
### Getting the tags list
@@ -517,8 +519,8 @@ use Storyblok\ManagementApi\ManagementApiClient;
517
519
$client = new ManagementApiClient($storyblokPersonalAccessToken);
518
520
519
521
$spaceId = "your-space-id";
520
-
$storyApi = $client->storyApi($spaceId);
521
-
$assetApi = $client->assetApi($spaceId);
522
+
$storyApi = new StoryApi($client, $spaceId);
523
+
$assetApi = new AssetApi($client, $spaceId);
522
524
523
525
echo "UPLOADING ASSET..." . PHP_EOL;
524
526
$response = $assetApi->upload("image.png");
@@ -565,7 +567,7 @@ If you need to handle workflows (retrieving workflows or create new custom workf
565
567
### Retrieving workflows
566
568
567
569
```php
568
-
$workflowApi = $client->workflowApi($spaceId);
570
+
$workflowApi = new WorkflowApi($client, $spaceId);
In this example, we are going to retrieve the first workflow id available (probably you should retrieve a proper workflow that makes sense for your use case):
609
611
610
612
```php
611
-
$workflowApi = $client->workflowApi($spaceId);
613
+
$workflowApi = new WorkflowApi($client, $spaceId);
612
614
$response = $workflowApi->list();
613
615
$workflowId = $response->data()->get("0.id");
614
616
```
@@ -654,14 +656,14 @@ $client = new ManagementApiClient($storyblokPersonalAccessToken);
654
656
Getting the ManagementApi instance:
655
657
656
658
```php
657
-
$managementApi = $client->managementApi()
659
+
$managementApi = new ManagementApi($client);
658
660
```
659
661
660
662
Calling GET HTTP method with `spaces/:spaceid/internal_tags`:
0 commit comments