mozilla-services/msisdn-gateway — pull request #56 by Natim (2014-05-27 12:15:57+00:00)
Title: /sms/mt/verify should allow short or full SMS code

## POST /v1/msisdn/sms/mt/verify

### Request

:lock: HAWK-authenticated with a `msisdnSessionToken`.

```sh
curl -v \
-X POST \
-H "Content-Type: application/json" \
"https://msisdn.accounts.firefox.com/v1/msisdn/sms/mt/verify" \
-H 'Authorization: Hawk id="d4c5b1e3f5791ef83896c27519979b93a45e6d0da34c7509c5632ac35b28b48d", ts="1373391043", nonce="ohQjqb", hash="vBODPWhDhiRWM4tmI9qp+np+3aoqEFzdGuGk0h7bh9w=", mac="LAnpP3P2PXelC6hUoUaHP72nCqY5Iibaa3eeiGBqIIU="' \
-d '{
"msisdn": "+442071838750"
}'
```

or

```sh
curl -v \
-X POST \
-H "Content-Type: application/json" \
"https://msisdn.accounts.firefox.com/v1/msisdn/sms/mt/verify" \
-H 'Authorization: Hawk id="d4c5b1e3f5791ef83896c27519979b93a45e6d0da34c7509c5632ac35b28b48d", ts="1373391043", nonce="ohQjqb", hash="vBODPWhDhiRWM4tmI9qp+np+3aoqEFzdGuGk0h7bh9w=", mac="LAnpP3P2PXelC6hUoUaHP72nCqY5Iibaa3eeiGBqIIU="' \
-H 'Accept-Language: da, en-gb' \
-d '{
"msisdn": "+442071838750",
"shortVerificationCode: true"
}'
```

___Parameters___
* `msisdn` - the client's claimed MSISDN in E.164 format.
* `shortVerificationCode` - (optional) if `true`, the server should send a short, human transcribable code with instructional text in the verification SMS. If `false` or excluded, the server will send a longer code without text. If `true`, the client should also take care to set the `Accept-Language` header so the server can appropriate localize any text in the SMS.

### Response

Successful requests will produce a "200 OK" response with following format:

```json
{}
```

Failing requests may be due to the following errors:

* status code 400, errno 106: request body was not valid json
* status code 400, errno 107: request body contains invalid parameters
* status code 400, errno 108: request body missing required parameters
* status code 401, errno 110: invalid authentication token
* status code 411, errno 112: content-length header was not provided
* status code 413, errno 113: request body too large
* status code 429, errno 114: client has sent too many requests with short verification code
* status code 429, errno 115: client has sent too many requests for MSISDN
* status code 429, errno 116: client has sent too many requests for verification method
* status code 429, errno 117: client has sent too many requests - unspecified
* status code 503, errno 201: service temporarily unavailable to due high load

Successful requests also trigger the sending of a SMS-MT message from the server's `mtSender` number to the client's MSISDN with verification code in the body:

(default)
```
aac4b1e3f1791ef83886c27519979b93a45e6d0da34c7509ca632aca5a28a47c
```

(`shortVerificationCode` is `true`)
```
Your verification code: 146193
```

Refs #52