Request
To change a PIN when the user knows the current PIN, send a PUT request to:
https://<host>:<port>/adm/v1/user/accounts/actions/changePin
The platform checks the current PIN before it changes it. If lockout has been set up for the PIN type in your deployment, a wrong current PIN counts towards the lockout, in the same way as a failed request to verify the PIN (see Verifying user-supplied PINs). NAGRAVISION sets the number of attempts and the lock time for each deployment. A correct PIN resets the count of wrong attempts. While the PIN is locked, the request is refused even if the current PIN is correct. You can check the status of each PIN as described in Getting the status of all PINs for the account.
If the user has forgotten the current PIN, the client can't change it with this request. The operator can reset the PIN instead, which also unlocks it – see Add or reset the PIN on an account – OTT.
Headers
-
Authorization– the client's access token, as a bearer token (Bearer <access token>). This is theaccess_tokenthat the client gets when it signs in – see Authentication token. This header is mandatory. -
Content-Type: application/json
Mandatory arguments
All the following arguments are in the request body:
-
type– the PIN type, for example the parental PIN -
value– the current PIN, as entered by the user -
newValue– the new PIN
Example
A PUT request with this payload changes the parental PIN:
{
"type": "ParentalPin",
"value": "1234",
"newValue": "5678"
}
Response
A successful request returns an HTTP 200 status. The response body says whether the PIN was updated, for example:
{
"matchedCount": 1,
"modifiedCount": 1
}
A bad request returns an HTTP 400 status:
-
"errorCode": 1001–type,valueornewValueis missing or empty, or the PIN type is not defined on the platform. -
"errorCode": 7124– the new PIN does not match the PIN format that is set up for this PIN type.
A forbidden request returns an HTTP 403 status – for example, if the access token is missing, invalid, or has expired, or if the current PIN is wrong:
-
"errorCode": 4566– the current PIN is wrong (no lockout is configured for this PIN type). -
"errorCode": 7123– the current PIN is wrong and the message gives the number of attempts left, or the PIN is locked (the message gives the number of seconds remaining).
If the account has no PIN of the specified type, the request returns an HTTP 404 status ("errorCode": 1001).
Before 26.26, a wrong current PIN returned an HTTP 401 status and did not count towards the lockout. If your client checks for 401 to detect a wrong PIN, update it to handle 403.
See also
For full details of this API, see Account and Device Manager (ADM) API documentation.