Skip to content

Commit 51e959b

Browse files
committed
Add a bit of explanation and an example to the README
1 parent 82ac1c4 commit 51e959b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,26 @@ $client->message()->search($message);
151151
echo "The body of the message was: " . $message->getBody();
152152
```
153153

154+
### Signing a Message
155+
156+
The SMS API supports the ability to sign messages by generating and adding a signature using a "Signature Secret" rather than your API secret. The algorithms supported are:
157+
158+
* `md5hash1`
159+
* `md5`
160+
* `sha1`
161+
* `sha256`
162+
* `sha512`
163+
164+
Both your application and Nexmo need to agree on which algorithm is used. In the [dashboard](https://dashboard.nexmo.com), visit your account settings page and under "API Settings" you can select the algorithm to use. This is also the location where you will find your "Signature Secret" (it's different from the API secret).
165+
166+
Create a client using these credentials and the algorithm to use, for example:
167+
168+
```php
169+
$client = new Nexmo\Client(new Nexmo\Client\Credentials\SignatureSecret(API_KEY, API_SECRET, 'sha256'));
170+
```
171+
172+
Using this client, your SMS API messages will be sent as signed messages.
173+
154174
### Starting a Verification
155175

156176
Nexmo's [Verify API][doc_verify] makes it easy to prove that a user has provided their own phone number during signup,

0 commit comments

Comments
 (0)