--- title: "HTTP client setup" slug: "hhtp-client-setup" updated: 2026-07-09T05:08:31Z published: 2026-07-09T05:08:31Z canonical: "help.frisbii.com/hhtp-client-setup" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.frisbii.com/llms.txt > Use this file to discover all available pages before exploring further. # HTTP client setup # Setting Up the HTTP Client All server-side calls to the Frisbii Media API are standard HTTPS requests. The examples in this documentation use [Guzzle](http://docs.guzzlephp.org/en/stable/overview.html#installation), but any HTTP client works — including Symfony's [HttpClient](https://symfony.com/doc/current/http_client.html) or plain [cURL](https://www.php.net/manual/de/book.curl.php). --- ## Install Guzzle Follow the [Guzzle installation guide](http://docs.guzzlephp.org/en/stable/overview.html#installation). With Composer: ```bash composer require guzzlehttp/guzzle ``` --- ## Initialise the client Set the `base_uri` to the Frisbii Media REST API. Use the stage URL during development, the production URL for live traffic. **Stage:** ```php $client = new GuzzleHttp\Client([    'base_uri' => 'https://api.frisbii-media-stage.com/api/v3.0/' ]); ``` **Production:** ```php $client = new GuzzleHttp\Client([    'base_uri' => 'https://api.frisbii-media.com/api/v3.0/' ]); ``` See [Environments: Stage vs. Production](/frisbii-media/docs/environments) for a full comparison. --- ## Authentication header Every request must include the `X-plenigo-token` header containing a freshly signed JWT. See [Authentication & API Tokens](/frisbii-media/docs/authentication-api-tokens) for how to generate this token. Pass it per request: ```php $response = $client->request('POST', 'customers', [    'headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9],    'json'    => $payload, ]); ``` Or set it as a client default if all requests share the same token: ```php $client = new GuzzleHttp\Client([    'base_uri' => 'https://api.frisbii-media.com/api/v3.0/',    'headers'  => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9], ]); ``` > [!NOTE] > The placeholder token `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...` that appears throughout the code examples in this documentation is for illustration only and will not work against the API. Always pass a token you generated yourself. --- ## Error handling Guzzle throws a `GuzzleHttp\Exception\ClientException` for 4xx responses and a `GuzzleHttp\Exception\ServerException` for 5xx responses. Always wrap API calls in a try/catch: ```php try {    $response = $client->request('GET', "accessRights/{$customerId}/hasAccess?accessRightUniqueIds=my-product", [        'headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9],    ]);    $result = json_decode($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\ClientException $e) {    // 404: resource not found — handle as no-access or not-found    $result = null; } ``` For more on Guzzle exceptions, see the [Guzzle documentation](http://docs.guzzlephp.org/en/stable/quickstart.html#exceptions).