Skip to content

Commit

Permalink
Merge pull request #97 from storyblok/feature/INT-1119
Browse files Browse the repository at this point in the history
Update readme with new regions.
  • Loading branch information
joaokamun authored Dec 8, 2023
2 parents d400227 + 40b3180 commit 25ab14d
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,18 @@ $result = $managementClient->delete('spaces/' . $spaceId . '/stories/' . $storyI
print_r($result);
```

### Using spaces created in the US region for Management API
### Using spaces created in other regions for Management API

When creating a Space, you can select the EU or US region.
If you want to access a Space created in US region, you need to define the `apiEndpoint` parameter with 'api-us.storyblok.com' value, and forcing the `ssl` option for using HTTPS protocol:
When creating a Space, you can select the EU, US, CA, AP region. The default region is EU.
```
EU: api.storyblok.com
US: api-us.storyblok.com
CA: api-ca.storyblok.com
AP: api-ap.storyblok.com
```

For example:
If you want to access a Space created in US region, you need to define the `apiEndpoint` parameter with `api-us.storyblok.com` value, and forcing the `ssl` option for using HTTPS protocol:

```php
use Storyblok\ManagementClient;
Expand Down Expand Up @@ -193,10 +201,12 @@ use Storyblok\Client as StoryblokClient;
$client = new StoryblokClient('your-storyblok-readonly-accesstoken');
```

### Using spaces created in the US region
### Using spaces created in the other regions

When you create a Space, you can select the region: EU, US, CA or AP.

When you create a Space, you can select the region: EU or US.
If you want to access a Space created in US region, you need to define the `apiRegion` parameter with 'us' value (or 'US'):
For example:
If you want to access a Space created in US region, you need to define the `apiRegion` parameter with the `us` value (or `US`):

```php
use Storyblok\Client;
Expand All @@ -219,7 +229,7 @@ $client = new Client(
);
```

Now you have the `Storyblok\Client` instance you can start consuming data.
Now you have the `Storyblok\Client` instance you can start consuming data.

### Load a Story by slug

Expand Down

0 comments on commit 25ab14d

Please sign in to comment.