Skip to content

Commit

Permalink
Merge pull request #112 from alphagov/remove-curl-docs
Browse files Browse the repository at this point in the history
Remove documentation for cURL support
  • Loading branch information
idavidmcdonald authored Jun 29, 2022
2 parents 853aacf + b233902 commit d0b3fa0
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This documentation is for developers interested in using the GOV.UK Notify PHP c

## Set up the client

The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/) and [cURL](http://php.net/manual/en/book.curl.php) [external links].
The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred PSR-7 compatible HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/)[external link].

### Guzzle v6

Expand Down Expand Up @@ -53,31 +53,6 @@ To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

### cURL

1. Use [Composer](https://getcomposer.org/) [external link] to install the GOV.UK Notify PHP client. Run the following in the command line:

```sh
composer require php-http/curl-client php-http/message alphagov/notifications-php-client
```

You can now use the [autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading) [external link] to download the GOV.UK Notify PHP client.

1. Add the following code to your application to create a new instance of the client:

```
$notifyClient = new \Alphagov\Notifications\Client([
'apiKey' => '{your api key}',
'httpClient' => new \Http\Client\Curl\Client(
new \Http\Message\MessageFactory\GuzzleMessageFactory,
new \Http\Message\StreamFactory\GuzzleStreamFactory
),
]);
```

1. Run `$notifyClient` to access the GOV.UK Notify API.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

## Send a message

Expand Down

0 comments on commit d0b3fa0

Please sign in to comment.