PHPackages                             storyblok/php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. storyblok/php-client

Abandoned → [storyblok/php-content-api-client](/?search=storyblok%2Fphp-content-api-client)ArchivedLibrary[API Development](/categories/api)

storyblok/php-client
====================

Storyblok Client to easily call the publishing api

v2.6.3(2y ago)341.0M—1.6%38[4 issues](https://github.com/storyblok/storyblok-php-client/issues)[1 PRs](https://github.com/storyblok/storyblok-php-client/pulls)6MITPHPPHP &gt;=7.3.0CI failing

Since Jun 4Pushed 1y ago11 watchersCompare

[ Source](https://github.com/storyblok/storyblok-php-client)[ Packagist](https://packagist.org/packages/storyblok/php-client)[ RSS](/packages/storyblok-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (59)Used By (6)

Warning

This package is discontinued and will only receive critical security updates.
Please use the new official [PHP Content API Client](https://github.com/storyblok/php-content-api-client).

 [ ![Storyblok Logo](https://camo.githubusercontent.com/cf33dc8f589e8778c02f61ba16a553c713dc0f5fb74af2a7d56ba03df471b44b/68747470733a2f2f612e73746f7279626c6f6b2e636f6d2f662f38383735312f31373736783336302f646336653531613566642f73622d7068702e706e67) ](https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=php-client)Storyblok PHP Client - Deprecated
=================================

[](#storyblok-php-client---deprecated)

This is the official [Storyblok](https://www.storyblok.com?utm_source=github.com&utm_medium=referral&utm_campaign=php-client) PHP client to easily access the Content Delivery API and Management API.

 [ ![Join the Storyblok Discord Community](https://camo.githubusercontent.com/b989aa598f8647fac24c28380061b904758a826e03c97da283af79cafca9bf6c/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3730303331363437383739323133383834323f6c6162656c3d4a6f696e2532304f7572253230446973636f7264253230436f6d6d756e697479267374796c653d6170707665796f72266c6f676f3d646973636f726426636f6c6f723d303962336166) ](https://discord.gg/jKrbAMz) [ ![Follow @Storyblok](https://camo.githubusercontent.com/740dd25c6e771db0276d5b9061795ec126d563ba55fd2f088358ff64fc2c8cd8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f772d25343073746f7279626c6f6b2d3039623361663f7374796c653d6170707665796f72266c6f676f3d74776974746572) ](https://twitter.com/intent/follow?screen_name=storyblok)
 [ ![Follow @Storyblok](https://camo.githubusercontent.com/77a1620ecc9733fb3da257e70df47931f82ab9e747ef7198bddf064449a5b10b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54727925323053746f7279626c6f6b2d467265652d3039623361663f7374796c653d6170707665796f72266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414247644254554541414c4750432f7868425141414144686c57456c6d545530414b67414141416741415964704141514141414142414141414767414141414141417141434141514141414142414141414871414441415141414141424141414148674141414144706952552f4141414352456c455156524944574e6747476d4145643344334a73334c50725038443857585a775350694d6a77367176506f48687947597749584e4162477062436a627a50304d59756a305946714d726f42562f7743786d4965536a75363465444e7a4d424a557876502f396932486e7135634d316465764d6e7a393834655173517745546552685957486749634a695871433656486c46426a55655867617634306349576b7a316f4c5958466d47774642496d6144464248794f62634f7a64573461537135655268526945326467596c7075596f59534b4a69387677334767576e79414a49732f4175507534736350474f62642f667156515a2b504879372b367564504f4273586779534c44666e35475259596d614b594a63584267574c707378382f47506138666f5769426875484a49736c32446b595171576b735a6b4446675035504f62634b595966662f2f6956414f5449446c782f515071524d622f5953594261576c4f546f5a4961566b475a6d415a53516951354f50747748776163756f3469706c4d514575367458555a4d685355474469596d426a796c46515976762f37783942303478714b4f6e514f795435474e2b44662f2f384d35394153584b794d484c6f794444354a5074626a34324f59726d2b4559676737304a66755975496f596d4c733741774d6a497a412b75592f7a6a416e79574a70446b36474f466e4376726e3836534f776d734e744b63695646416331696c65424846444336376c7a4731305967302b536a7a46306f776e73662f4f616f66764f4c596144514a6f514947697839346c6a763167495a4938507633387a50766a326c515759663348474b62704443467038357630374e6e524e314f42545059364a6452534778634377326b36735a754c564d5a354156347331546f7a506e4747464b627a2b2f504537494a73486d432f2f4d444d7968584277386536467952464c76335a302f494b7546717646794971417a64315077427a4a77386a41475066567833384a7368776c62497967786d595934332f47516d70616973304f444448757a65764c4d41524842636749415141624f4a485a57302f45795141414141424a52553545726b4a6767673d3d) ](https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=php-client)

🚀 Usage
-------

[](#-usage)

With the **Storyblok PHP client** you can integrate two kinds of Storyblok APIs:

- Management API: typically used for managing data, like creating data, blocks, settings etc.
- Content Delivery API: typically used for retrieving data, for example when you want to build your public Web application.

In this README file you will find information for using the Storyblok PHP client, like:

- [Installing Storyblok PHP client](#installing-the-storyblok-php-client)
- [Using the Management API](#management-api)
- [Using the Content Delivery API](#content-delivery-api)
- [Retrieving Draft or Published content](#retrieving-draft-or-published-content)
- [Managing cache](#managing-cache)
- [Resolve Relations and Links](#relationships-and-links-resolving)

Installing the Storyblok PHP client
-----------------------------------

[](#installing-the-storyblok-php-client)

You can install the Storyblok PHP Client via composer. Storyblok's PHP client requires PHP version 7.3 to 8.3. The suggestion is to use an actively supported version of PHP (8.2 and 8.3).

If you want to install the *stable* release of Storyblok PHP client you can launch:

```
composer require storyblok/php-client
```

If you want to install the *current* development release, you can add the version `dev-master`:

```
composer require storyblok/php-client dev-master
```

For executing the command above, you need to have composer installed on your development environment. If you need to install Composer, you can follow the official Composer documentation:

- Install Composer on [GNU Linux / Unix / macOS](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos)
- Install Composer on [Windows](https://getcomposer.org/doc/00-intro.md#installation-windows)

We suggest using the latest version of PHP.

Management API
--------------

[](#management-api)

### The Storyblok\\ManagementClient instance

[](#the-storyblokmanagementclient-instance)

Now we are going to see how to initialize the Storyblok Management Client for the [Management](https://www.storyblok.com/docs/api/management) API\]() with your Personal OAuth Token. The Personal OAuth token is taken from the "My Account" section. This token is used for read and write operations. The class for using the Management API is the `Storyblok\ManagementClient` class. When you are going to instance a new `ManagementClient` object you can use the Personal OAuth Token as a parameter.

```
