Appearance
trader.password
2 methods on trader.password. Each returns the answer's data and throws NoviqaError on a failed answer.
forgot
POST
/trader/v1/password/forgotE-mail a password recovery code (trader)
Public. Send the login and its e-mail; when they match an account of this side a code is e-mailed. The answer is the same either way.
Request body
codestringemailstringloginintegerLogin is the numeric identity of every account, trader or staff.
passwordstringReturns
Promise<docSent>The answer's
data.Errors
400
invalid_input: invalid input403
forbidden: you do not have access to this action429
auth.too_many_attempts: too many attempts, try again later500
internal: something went wrongts
import { trader } from "@/lib/noviqa"
const data = await trader.password.forgot({
email: "ann@example.com",
login: 1000
})bash
curl -X POST "$NOVIQA_API_URL/trader/v1/password/forgot" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"email": "ann@example.com",
"login": 1000
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"sent": true
},
"request_id": "5b7f2c1e"
}ts
trader.password.forgot(body: auth.Recovery, options?: RequestOptions): Promise<http.docSent>reset
POST
/trader/v1/password/resetSet a new password with the e-mailed code (trader)
Public. Login, e-mail, the code and the new password. Closes every session of the login.
Request body
codestringemailstringloginintegerLogin is the numeric identity of every account, trader or staff.
passwordstringReturns
Promise<null>The answer's
data.Errors
400
auth.code_invalid: the verification code is wrong or has expired400
auth.password_weak: password must be 8-16 characters with a lower, upper, digit and symbol400
invalid_input: invalid input403
forbidden: you do not have access to this action429
auth.too_many_attempts: too many attempts, try again later500
internal: something went wrongts
import { trader } from "@/lib/noviqa"
const data = await trader.password.reset({
code: "123456",
email: "ann@example.com",
login: 1000,
password: "N3w#Pass1"
})bash
curl -X POST "$NOVIQA_API_URL/trader/v1/password/reset" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"code": "123456",
"email": "ann@example.com",
"login": 1000,
"password": "N3w#Pass1"
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": null,
"request_id": "5b7f2c1e"
}ts
trader.password.reset(body: auth.Recovery, options?: RequestOptions): Promise<null>